Compare commits
63 Commits
Author | SHA1 | Date | |
---|---|---|---|
24171eea43 | |||
a008a9d1aa | |||
5011954847 | |||
2c7445c5a6 | |||
bf5e3e1839 | |||
f80767454a | |||
bfb243c233 | |||
e0209e29d6 | |||
213c4d681c | |||
60c42befdf | |||
d31d9507d2 | |||
ca84069e9a | |||
dd2e3848cc | |||
8c56b88113 | |||
cc0bb86a53 | |||
b3eeaef41d | |||
0ac4e4c9c0 | |||
35bbe91eb4 | |||
b4ce8e9642 | |||
479cf6a937 | |||
acea57bcba | |||
64e8aa2816 | |||
38801b52a7 | |||
e73f39cfa9 | |||
7536ca8683 | |||
493991edd1 | |||
29003eae80 | |||
79b977a55a | |||
df9083c3e2 | |||
f3e7f4f229 | |||
12864cdb44 | |||
671a0a8391 | |||
553b1c1fcd | |||
f040c6454d | |||
f0599f6d54 | |||
042bb964e5 | |||
a3089ef956 | |||
0683a11b78 | |||
532fbb352c | |||
a1a02a1230 | |||
e5146a7cd5 | |||
dedbe43c3e | |||
218c6b4672 | |||
800e9756c5 | |||
24e1d948f2 | |||
bf758803cc | |||
62e481fb1e | |||
ff4bff38dd | |||
f417993c85 | |||
8bebb40c9f | |||
ec68e67645 | |||
95894ba00f | |||
ad19153225 | |||
8d476bbec6 | |||
b233f94a24 | |||
6351fb1bbc | |||
0e11945f1d | |||
d3d454a2d7 | |||
b150024bff | |||
0ad6216cde | |||
8925458665 | |||
25f8effd19 | |||
9c6c504ae5 |
2
.github/workflows/black.yml
vendored
2
.github/workflows/black.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
|
4
.github/workflows/build-test.yml
vendored
4
.github/workflows/build-test.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
@ -49,7 +49,7 @@ jobs:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: true
|
||||
|
2
.github/workflows/generate-docs.yml
vendored
2
.github/workflows/generate-docs.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
|
4
.github/workflows/make-release.yml
vendored
4
.github/workflows/make-release.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
@ -28,4 +28,4 @@ jobs:
|
||||
# TODO: generate a nice little doc for the release text like we do for the
|
||||
# cli repo.
|
||||
- name: Create a Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
2
.github/workflows/mypy.yml
vendored
2
.github/workflows/mypy.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
|
4
.github/workflows/ruff.yml
vendored
4
.github/workflows/ruff.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
@ -35,4 +35,4 @@ jobs:
|
||||
- name: Run ruff
|
||||
shell: bash
|
||||
run: |
|
||||
poetry run ruff check --format=github .
|
||||
poetry run ruff check --output-format=github .
|
||||
|
14
.github/workflows/update-spec-for-docs.yml
vendored
14
.github/workflows/update-spec-for-docs.yml
vendored
@ -15,6 +15,13 @@ jobs:
|
||||
name: update-spec
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
# required
|
||||
app-id: ${{ secrets.GH_ORG_APP_ID }}
|
||||
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
- name: make generate
|
||||
shell: bash
|
||||
@ -38,7 +45,7 @@ jobs:
|
||||
with:
|
||||
repository: 'kittycad/website'
|
||||
path: 'docs'
|
||||
token: ${{secrets.PAT_GITHUB}}
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: move spec to docs
|
||||
shell: bash
|
||||
run: |
|
||||
@ -60,8 +67,11 @@ jobs:
|
||||
gh pr create --title "Update lang spec docs for python" \
|
||||
--body "Updating the generated docs for python" \
|
||||
--head "$NEW_BRANCH" \
|
||||
--reviewer jessfraz \
|
||||
--reviewer irev-dev \
|
||||
--reviewer franknoirot \
|
||||
--base main || true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PAT_GITHUB}}
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
|
||||
|
@ -1,18 +1,16 @@
|
||||

|
||||
|
||||
# kittycad.py
|
||||
|
||||
The Python API client for KittyCAD.
|
||||
|
||||
- [PyPI](https://pypi.org/project/kittycad/)
|
||||
- [Python docs](https://python.api.docs.kittycad.io/)
|
||||
- [KittyCAD API Docs](https://docs.kittycad.io/?lang=python)
|
||||
- [Python docs](https://python.api.docs.zoo.dev/)
|
||||
- [KittyCAD API Docs](https://zoo.dev/docs/api?lang=python)
|
||||
|
||||
## Generating
|
||||
|
||||
You can trigger a build with the GitHub action to generate the client. This will
|
||||
automatically update the client to the latest version based on the spec hosted
|
||||
at [api.kittycad.io](https://api.kittycad.io/).
|
||||
at [api.zoo.dev](https://api.zoo.dev/).
|
||||
|
||||
Alternatively, if you wish to generate the client locally, make sure you have
|
||||
[Docker installed](https://docs.docker.com/get-docker/) and run:
|
||||
|
@ -154,10 +154,19 @@ class WebSocket:
|
||||
self.ws = sync(
|
||||
{% for arg in args %}
|
||||
{% if arg.in_query %}
|
||||
{% if arg.is_optional == False %}
|
||||
{{arg.name}},
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
client=client,
|
||||
{% for arg in args %}
|
||||
{% if arg.in_query %}
|
||||
{% if arg.is_optional %}
|
||||
{{arg.name}}={{arg.name}},
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
)
|
||||
|
||||
def __enter__(self,
|
||||
|
@ -51,7 +51,7 @@ def _get_kwargs(
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
{% if has_request_body %}"content": body,{% endif %}
|
||||
{% if has_request_body %}{% if request_body_type != "bytes" %}"content": body.model_dump_json(),{% else %}"content": body,{% endif %}{% endif %}
|
||||
}
|
||||
|
||||
|
||||
|
@ -233,7 +233,11 @@ def generateTypeAndExamplePython(
|
||||
elif (
|
||||
schema["type"] == "number"
|
||||
and "format" in schema
|
||||
and (schema["format"] == "float" or schema["format"] == "double")
|
||||
and (
|
||||
schema["format"] == "float"
|
||||
or schema["format"] == "double"
|
||||
or schema["format"] == "money-usd"
|
||||
)
|
||||
):
|
||||
parameter_type = "float"
|
||||
parameter_example = "3.14"
|
||||
@ -474,11 +478,16 @@ from kittycad.types import Response
|
||||
for endpoint_ref in endpoint_refs:
|
||||
if endpoint_ref == "Error":
|
||||
continue
|
||||
example_imports = example_imports + (
|
||||
"""from kittycad.models import """
|
||||
+ endpoint_ref.replace("List[", "").replace("]", "")
|
||||
+ "\n"
|
||||
)
|
||||
# For some reason, PrivacySettings is showing up twice so we want to skip
|
||||
# it here. Obviously this is a hack and we should fix the root cause.
|
||||
# When this happens again with another struct there might be a more obvious
|
||||
# solution, but alas, I am lazy.
|
||||
if endpoint_ref != "PrivacySettings" and endpoint_ref != "List[str]":
|
||||
example_imports = example_imports + (
|
||||
"""from kittycad.models import """
|
||||
+ endpoint_ref.replace("List[", "").replace("]", "")
|
||||
+ "\n"
|
||||
)
|
||||
example_imports = (
|
||||
example_imports + "from typing import Union, Any, Optional, List, Tuple\n"
|
||||
)
|
||||
@ -518,7 +527,7 @@ from kittycad.types import Response
|
||||
|
||||
short_sync_example = short_sync_example + (
|
||||
"""
|
||||
if isinstance(result, Error) or result == None:
|
||||
if isinstance(result, Error) or result is None:
|
||||
print(result)
|
||||
raise Exception("Error in response")
|
||||
|
||||
@ -705,6 +714,7 @@ async def test_"""
|
||||
"docs": str,
|
||||
"parse_response": str,
|
||||
"has_request_body": bool,
|
||||
"request_body_type": str,
|
||||
},
|
||||
)
|
||||
template_info: TemplateType = {
|
||||
@ -716,6 +726,7 @@ async def test_"""
|
||||
"docs": "",
|
||||
"parse_response": "",
|
||||
"has_request_body": False,
|
||||
"request_body_type": "",
|
||||
}
|
||||
|
||||
if len(endpoint_refs) == 0:
|
||||
@ -835,6 +846,20 @@ async def test_"""
|
||||
"\t\t\tfor item in response.json()\n"
|
||||
)
|
||||
parse_response.write("\t\t]\n")
|
||||
elif "type" in items:
|
||||
if items["type"] == "string":
|
||||
parse_response.write(
|
||||
"\t\tresponse_"
|
||||
+ response_code
|
||||
+ " = [\n"
|
||||
)
|
||||
parse_response.write("\t\t\tstr(**item)\n")
|
||||
parse_response.write(
|
||||
"\t\t\tfor item in response.json()\n"
|
||||
)
|
||||
parse_response.write("\t\t]\n")
|
||||
else:
|
||||
raise Exception("Unknown array type", items)
|
||||
else:
|
||||
raise Exception("Unknown array type")
|
||||
elif json["type"] == "string":
|
||||
@ -843,7 +868,17 @@ async def test_"""
|
||||
+ response_code
|
||||
+ " = response.text\n"
|
||||
)
|
||||
elif (
|
||||
json["type"] == "object"
|
||||
and "additionalProperties" in json
|
||||
):
|
||||
parse_response.write(
|
||||
"\t\tresponse_"
|
||||
+ response_code
|
||||
+ " = response.json()\n"
|
||||
)
|
||||
else:
|
||||
print(json)
|
||||
raise Exception("Unknown type", json["type"])
|
||||
else:
|
||||
parse_response.write(
|
||||
@ -954,6 +989,7 @@ async def test_"""
|
||||
}
|
||||
)
|
||||
template_info["has_request_body"] = True
|
||||
template_info["request_body_type"] = request_body_type
|
||||
|
||||
# Generate the template for the functions.
|
||||
environment = jinja2.Environment(loader=jinja2.FileSystemLoader("generate/"))
|
||||
@ -1014,7 +1050,7 @@ def generateType(path: str, name: str, schema: dict, data: dict):
|
||||
elif type_name == "integer":
|
||||
generateIntegerType(file_path, name, schema, type_name)
|
||||
elif type_name == "number":
|
||||
generateIntegerType(file_path, name, schema, type_name)
|
||||
generateFloatType(file_path, name, schema, type_name)
|
||||
elif type_name == "string":
|
||||
generateStringType(file_path, name, schema, type_name)
|
||||
else:
|
||||
@ -1234,7 +1270,7 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
|
||||
f.write("from ." + camel_to_snake(ref_name) + " import " + ref_name + "\n")
|
||||
all_options.append(ref_name)
|
||||
|
||||
if isNestedObjectOneOf(schema):
|
||||
if isNestedObjectAnyOf(schema):
|
||||
# We want to write each of the nested objects.
|
||||
for any_of in schema["anyOf"]:
|
||||
# Get the nested object.
|
||||
@ -1290,6 +1326,47 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
|
||||
f.write(object_code)
|
||||
f.write("\n")
|
||||
all_options.append(object_name)
|
||||
else:
|
||||
# We want to write each of the nested objects.
|
||||
for any_of in schema["anyOf"]:
|
||||
# Get the nested object.
|
||||
if "properties" in any_of:
|
||||
for prop_name in any_of["properties"]:
|
||||
nested_object = any_of["properties"][prop_name]
|
||||
if nested_object == {}:
|
||||
f.write("from typing import Any\n")
|
||||
f.write(prop_name + " = Any\n")
|
||||
f.write("\n")
|
||||
all_options.append(prop_name)
|
||||
elif "$ref" in nested_object:
|
||||
ref = nested_object["$ref"]
|
||||
ref_name = ref[ref.rfind("/") + 1 :]
|
||||
f.write(
|
||||
"from ."
|
||||
+ camel_to_snake(ref_name)
|
||||
+ " import "
|
||||
+ ref_name
|
||||
+ "\n"
|
||||
)
|
||||
f.write("\n")
|
||||
if prop_name != ref_name:
|
||||
f.write(prop_name + " = " + ref_name + "\n")
|
||||
f.write("\n")
|
||||
all_options.append(prop_name)
|
||||
else:
|
||||
object_code = generateObjectTypeCode(
|
||||
prop_name, nested_object, "object", data, None, None
|
||||
)
|
||||
f.write(object_code)
|
||||
f.write("\n")
|
||||
all_options.append(prop_name)
|
||||
elif "type" in any_of and any_of["type"] == "string":
|
||||
enum_code = generateEnumTypeCode(
|
||||
any_of["enum"][0], any_of, "string", []
|
||||
)
|
||||
f.write(enum_code)
|
||||
f.write("\n")
|
||||
all_options.append(any_of["enum"][0])
|
||||
|
||||
# Write the sum type.
|
||||
description = getAnyOfDescription(schema)
|
||||
@ -1497,6 +1574,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)
|
||||
@ -1542,7 +1637,7 @@ def generateObjectTypeCode(
|
||||
|
||||
description = ""
|
||||
if "description" in schema:
|
||||
description = schema["description"]
|
||||
description = schema["description"].replace('"', '\\"')
|
||||
|
||||
imports = []
|
||||
refs = getRefs(schema)
|
||||
@ -1642,8 +1737,9 @@ def getRefs(schema: dict) -> List[str]:
|
||||
# do nothing
|
||||
pass
|
||||
else:
|
||||
logging.error("unsupported type: ", schema)
|
||||
raise Exception("unsupported type: ", schema)
|
||||
# This is likely an empty object like above but with a description
|
||||
# so we will just skip it.
|
||||
pass
|
||||
elif type_name == "array":
|
||||
if "items" in schema:
|
||||
schema_refs = getRefs(schema["items"])
|
||||
@ -1687,11 +1783,21 @@ def getEndpointRefs(endpoint: dict, data: dict) -> List[str]:
|
||||
if "$ref" in items:
|
||||
ref = items["$ref"].replace("#/components/schemas/", "")
|
||||
refs.append("List[" + ref + "]")
|
||||
elif "type" in items:
|
||||
if items["type"] == "string":
|
||||
refs.append("List[str]")
|
||||
else:
|
||||
raise Exception("Unknown array type", items)
|
||||
else:
|
||||
raise Exception("Unknown array type")
|
||||
raise Exception("Unknown array type", items)
|
||||
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")
|
||||
@ -1761,6 +1867,11 @@ def getRequestBodyRefs(endpoint: dict) -> List[str]:
|
||||
if "$ref" in form:
|
||||
ref = form["$ref"].replace("#/components/schemas/", "")
|
||||
refs.append(ref)
|
||||
elif content_type == "multipart/form-data":
|
||||
form = content[content_type]["schema"]
|
||||
if "$ref" in form:
|
||||
ref = form["$ref"].replace("#/components/schemas/", "")
|
||||
refs.append(ref)
|
||||
else:
|
||||
# Throw an error for an unsupported content type.
|
||||
logging.error("content: ", content)
|
||||
@ -1799,6 +1910,15 @@ def getRequestBodyTypeSchema(
|
||||
elif form != {}:
|
||||
logging.error("not a ref: ", form)
|
||||
raise Exception("not a ref")
|
||||
elif content_type == "multipart/form-data":
|
||||
form = content[content_type]["schema"]
|
||||
if "$ref" in form:
|
||||
ref = form["$ref"].replace("#/components/schemas/", "")
|
||||
type_schema = data["components"]["schemas"][ref]
|
||||
return ref, type_schema
|
||||
elif form != {}:
|
||||
type_schema = form
|
||||
return None, type_schema
|
||||
else:
|
||||
logging.error("unsupported content type: ", content_type)
|
||||
raise Exception("unsupported content type")
|
||||
@ -1874,6 +1994,40 @@ def getOneOfRefType(schema: dict) -> str:
|
||||
raise Exception("Cannot get oneOf ref type for schema: ", schema)
|
||||
|
||||
|
||||
def isNestedObjectAnyOf(schema: dict) -> bool:
|
||||
if "anyOf" not in schema:
|
||||
return False
|
||||
|
||||
is_nested_object = False
|
||||
for any_of in schema["anyOf"]:
|
||||
# Check if each are an object w 1 property in it.
|
||||
if (
|
||||
"type" in any_of
|
||||
and any_of["type"] == "object"
|
||||
and "properties" in any_of
|
||||
and len(any_of["properties"]) == 1
|
||||
):
|
||||
for prop_name in any_of["properties"]:
|
||||
nested_object = any_of["properties"][prop_name]
|
||||
if "type" in nested_object and nested_object["type"] == "object":
|
||||
is_nested_object = True
|
||||
else:
|
||||
is_nested_object = False
|
||||
break
|
||||
elif (
|
||||
"type" in any_of
|
||||
and any_of["type"] == "string"
|
||||
and "enum" in any_of
|
||||
and len(any_of["enum"]) == 1
|
||||
):
|
||||
is_nested_object = True
|
||||
else:
|
||||
is_nested_object = False
|
||||
break
|
||||
|
||||
return is_nested_object
|
||||
|
||||
|
||||
def isNestedObjectOneOf(schema: dict) -> bool:
|
||||
if "oneOf" not in schema:
|
||||
return False
|
||||
@ -1882,7 +2036,8 @@ def isNestedObjectOneOf(schema: dict) -> bool:
|
||||
for one_of in schema["oneOf"]:
|
||||
# Check if each are an object w 1 property in it.
|
||||
if (
|
||||
one_of["type"] == "object"
|
||||
"type" in one_of
|
||||
and one_of["type"] == "object"
|
||||
and "properties" in one_of
|
||||
and len(one_of["properties"]) == 1
|
||||
):
|
||||
@ -1894,7 +2049,10 @@ def isNestedObjectOneOf(schema: dict) -> bool:
|
||||
is_nested_object = False
|
||||
break
|
||||
elif (
|
||||
one_of["type"] == "string" and "enum" in one_of and len(one_of["enum"]) == 1
|
||||
"type" in one_of
|
||||
and one_of["type"] == "string"
|
||||
and "enum" in one_of
|
||||
and len(one_of["enum"]) == 1
|
||||
):
|
||||
is_nested_object = True
|
||||
else:
|
||||
|
@ -2,7 +2,7 @@ import datetime
|
||||
from typing import List, Optional, Dict, Union, Any, Literal
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Base64Bytes, AnyUrl
|
||||
from pydantic import BaseModel, Base64Bytes, AnyUrl, ConfigDict
|
||||
from pydantic_extra_types.phone_numbers import PhoneNumber
|
||||
from .base64data import Base64Data
|
||||
|
||||
@ -19,3 +19,7 @@ class {{ name }}(BaseModel):
|
||||
{{ field.name }}: {{ field.type }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
model_config = ConfigDict(
|
||||
protected_namespaces=()
|
||||
)
|
||||
|
@ -20,9 +20,9 @@ poetry run python generate/generate.py
|
||||
|
||||
# Format and lint.
|
||||
poetry run isort .
|
||||
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
|
||||
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py kittycad/models/*.py kittycad/api/*.py kittycad/api/*/*.py
|
||||
poetry run ruff check --fix .
|
||||
poetry run mypy .
|
||||
poetry run mypy . || true
|
||||
|
||||
|
||||
# Run the tests.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """ # noqa: E501
|
||||
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate CAD models. """ # noqa: E501
|
||||
|
116
kittycad/api/ai/create_kcl_code_completions.py
Normal file
116
kittycad/api/ai/create_kcl_code_completions.py
Normal file
@ -0,0 +1,116 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.kcl_code_completion_request import KclCodeCompletionRequest
|
||||
from ...models.kcl_code_completion_response import KclCodeCompletionResponse
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: KclCodeCompletionRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/ai/kcl/completions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[KclCodeCompletionResponse, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = KclCodeCompletionResponse(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[KclCodeCompletionResponse, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: KclCodeCompletionRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[KclCodeCompletionResponse, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: KclCodeCompletionRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[KclCodeCompletionResponse, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: KclCodeCompletionRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[KclCodeCompletionResponse, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: KclCodeCompletionRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[KclCodeCompletionResponse, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -29,7 +29,7 @@ def _get_kwargs(
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body,
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +86,6 @@ def sync(
|
||||
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
|
||||
This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.
|
||||
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
|
||||
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
@ -123,7 +122,6 @@ async def asyncio(
|
||||
"""Because our source of truth for the resulting model is a STEP file, you will always have STEP file contents when you list your generated models. Any other formats you request here will also be returned when you list your generated models.
|
||||
This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.
|
||||
One thing to note, if you hit the cache, this endpoint will return right away. So you only have to wait if the status is not `Completed` or `Failed`.
|
||||
This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
|
@ -20,6 +20,7 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if feedback is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&feedback=" + str(feedback)
|
||||
else:
|
||||
|
@ -21,18 +21,21 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
|
@ -15,29 +15,40 @@ def _get_kwargs(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/text-to-cad".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
if no_models is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&no_models=" + str(no_models)
|
||||
else:
|
||||
url = url + "?no_models=" + str(no_models)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
@ -81,11 +92,13 @@ def sync_detailed(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -103,6 +116,7 @@ def sync(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Optional[Union[TextToCadResultsPage, Error]]:
|
||||
"""This will always return the STEP file contents as well as the format the user originally requested.
|
||||
This endpoint requires authentication by any Zoo user. It returns the text-to-CAD models for the authenticated user.
|
||||
@ -113,6 +127,7 @@ def sync(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
@ -123,11 +138,13 @@ async def asyncio_detailed(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Response[Optional[Union[TextToCadResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -143,6 +160,7 @@ async def asyncio(
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
no_models: Optional[bool] = None,
|
||||
) -> Optional[Union[TextToCadResultsPage, Error]]:
|
||||
"""This will always return the STEP file contents as well as the format the user originally requested.
|
||||
This endpoint requires authentication by any Zoo user. It returns the text-to-CAD models for the authenticated user.
|
||||
@ -154,6 +172,7 @@ async def asyncio(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
no_models=no_models,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
|
117
kittycad/api/api_calls/get_api_call_for_org.py
Normal file
117
kittycad/api/api_calls/get_api_call_for_org.py
Normal file
@ -0,0 +1,117 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price import ApiCallWithPrice
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/api-calls/{id}".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ApiCallWithPrice, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ApiCallWithPrice(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ApiCallWithPrice, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It returns details of the requested API call for the user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ApiCallWithPrice, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ApiCallWithPrice, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It returns details of the requested API call for the user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -19,6 +19,7 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if group_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&group_by=" + str(group_by)
|
||||
else:
|
||||
|
@ -35,9 +35,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[
|
||||
Union[
|
||||
FileConversion,
|
||||
FileCenterOfMass,
|
||||
@ -123,9 +121,7 @@ def _parse_response(
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[
|
||||
def _build_response(*, response: httpx.Response) -> Response[
|
||||
Optional[
|
||||
Union[
|
||||
FileConversion,
|
||||
|
@ -21,18 +21,21 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
|
@ -23,18 +23,21 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
|
@ -23,24 +23,28 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
if status is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&status=" + str(status)
|
||||
else:
|
||||
|
162
kittycad/api/api_calls/org_list_api_calls.py
Normal file
162
kittycad/api/api_calls/org_list_api_calls.py
Normal file
@ -0,0 +1,162 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price_results_page import ApiCallWithPriceResultsPage
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/api-calls".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ApiCallWithPriceResultsPage(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
|
||||
"""This includes all API calls that were made by users in the org.
|
||||
This endpoint requires authentication by an org admin. It returns the API calls for the authenticated user's org.
|
||||
The API calls are returned in order of creation, with the most recently created API calls first.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
|
||||
"""This includes all API calls that were made by users in the org.
|
||||
This endpoint requires authentication by an org admin. It returns the API calls for the authenticated user's org.
|
||||
The API calls are returned in order of creation, with the most recently created API calls first.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -21,18 +21,21 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
|
@ -11,11 +11,19 @@ from ...types import Response
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/api-tokens".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if label is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&label=" + str(label)
|
||||
else:
|
||||
url = url + "?label=" + str(label)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
@ -54,8 +62,10 @@ def _build_response(
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ApiToken, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
label=label,
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -70,10 +80,12 @@ def sync_detailed(
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Optional[Union[ApiToken, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It creates a new API token for the authenticated user.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
label=label,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
@ -81,8 +93,10 @@ def sync(
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ApiToken, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
label=label,
|
||||
client=client,
|
||||
)
|
||||
|
||||
@ -95,11 +109,13 @@ async def asyncio_detailed(
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Optional[Union[ApiToken, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It creates a new API token for the authenticated user.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
label=label,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
|
@ -21,18 +21,21 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
|
@ -22,6 +22,7 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if output is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&output=" + str(output)
|
||||
else:
|
||||
@ -40,9 +41,9 @@ def _get_kwargs(
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CodeOutput(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 201:
|
||||
response_201 = CodeOutput(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
@ -92,6 +93,7 @@ def sync(
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Optional[Union[CodeOutput, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
lang=lang,
|
||||
output=output,
|
||||
@ -127,6 +129,7 @@ async def asyncio(
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Optional[Union[CodeOutput, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
lang=lang,
|
||||
|
@ -22,12 +22,14 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if output_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&output_unit=" + str(output_unit)
|
||||
else:
|
||||
url = url + "?output_unit=" + str(output_unit)
|
||||
|
||||
if src_format is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&src_format=" + str(src_format)
|
||||
else:
|
||||
|
@ -25,24 +25,28 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if material_mass is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&material_mass=" + str(material_mass)
|
||||
else:
|
||||
url = url + "?material_mass=" + str(material_mass)
|
||||
|
||||
if material_mass_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&material_mass_unit=" + str(material_mass_unit)
|
||||
else:
|
||||
url = url + "?material_mass_unit=" + str(material_mass_unit)
|
||||
|
||||
if output_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&output_unit=" + str(output_unit)
|
||||
else:
|
||||
url = url + "?output_unit=" + str(output_unit)
|
||||
|
||||
if src_format is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&src_format=" + str(src_format)
|
||||
else:
|
||||
|
@ -25,24 +25,28 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if material_density is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&material_density=" + str(material_density)
|
||||
else:
|
||||
url = url + "?material_density=" + str(material_density)
|
||||
|
||||
if material_density_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&material_density_unit=" + str(material_density_unit)
|
||||
else:
|
||||
url = url + "?material_density_unit=" + str(material_density_unit)
|
||||
|
||||
if output_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&output_unit=" + str(output_unit)
|
||||
else:
|
||||
url = url + "?output_unit=" + str(output_unit)
|
||||
|
||||
if src_format is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&src_format=" + str(src_format)
|
||||
else:
|
||||
|
@ -22,12 +22,14 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if output_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&output_unit=" + str(output_unit)
|
||||
else:
|
||||
url = url + "?output_unit=" + str(output_unit)
|
||||
|
||||
if src_format is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&src_format=" + str(src_format)
|
||||
else:
|
||||
|
@ -22,12 +22,14 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if output_unit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&output_unit=" + str(output_unit)
|
||||
else:
|
||||
url = url + "?output_unit=" + str(output_unit)
|
||||
|
||||
if src_format is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&src_format=" + str(src_format)
|
||||
else:
|
||||
|
@ -5,7 +5,7 @@ import httpx
|
||||
from ...client import Client
|
||||
from ...models.email_authentication_form import EmailAuthenticationForm
|
||||
from ...models.error import Error
|
||||
from ...models.verification_token import VerificationToken
|
||||
from ...models.verification_token_response import VerificationTokenResponse
|
||||
from ...types import Response
|
||||
|
||||
|
||||
@ -26,15 +26,15 @@ def _get_kwargs(
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body,
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[VerificationToken, Error]]:
|
||||
) -> Optional[Union[VerificationTokenResponse, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = VerificationToken(**response.json())
|
||||
response_201 = VerificationTokenResponse(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
@ -47,7 +47,7 @@ def _parse_response(
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[VerificationToken, Error]]]:
|
||||
) -> Response[Optional[Union[VerificationTokenResponse, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -60,7 +60,7 @@ def sync_detailed(
|
||||
body: EmailAuthenticationForm,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[VerificationToken, Error]]]:
|
||||
) -> Response[Optional[Union[VerificationTokenResponse, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
@ -78,7 +78,8 @@ def sync(
|
||||
body: EmailAuthenticationForm,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[VerificationToken, Error]]:
|
||||
) -> Optional[Union[VerificationTokenResponse, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
@ -89,7 +90,7 @@ async def asyncio_detailed(
|
||||
body: EmailAuthenticationForm,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[VerificationToken, Error]]]:
|
||||
) -> Response[Optional[Union[VerificationTokenResponse, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
@ -105,7 +106,8 @@ async def asyncio(
|
||||
body: EmailAuthenticationForm,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[VerificationToken, Error]]:
|
||||
) -> Optional[Union[VerificationTokenResponse, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
|
@ -19,18 +19,21 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if callback_url is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&callback_url=" + str(callback_url)
|
||||
else:
|
||||
url = url + "?callback_url=" + str(callback_url)
|
||||
|
||||
if email is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&email=" + str(email)
|
||||
else:
|
||||
url = url + "?email=" + str(email)
|
||||
|
||||
if token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&token=" + str(token)
|
||||
else:
|
||||
@ -96,6 +99,7 @@ def sync(
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Optional[Error]:
|
||||
|
||||
return sync_detailed(
|
||||
callback_url=callback_url,
|
||||
email=email,
|
||||
@ -131,6 +135,7 @@ async def asyncio(
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Optional[Error]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
callback_url=callback_url,
|
||||
|
127
kittycad/api/hidden/get_auth_saml.py
Normal file
127
kittycad/api/hidden/get_auth_saml.py
Normal file
@ -0,0 +1,127 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
provider_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/auth/saml/provider/{provider_id}/login".format(
|
||||
client.base_url,
|
||||
provider_id=provider_id,
|
||||
) # noqa: E501
|
||||
|
||||
if callback_url is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&callback_url=" + str(callback_url)
|
||||
else:
|
||||
url = url + "?callback_url=" + str(callback_url)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
provider_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
provider_id=provider_id,
|
||||
callback_url=callback_url,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
provider_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Optional[Error]:
|
||||
"""The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
provider_id=provider_id,
|
||||
callback_url=callback_url,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
provider_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
provider_id=provider_id,
|
||||
callback_url=callback_url,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
provider_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Optional[Error]:
|
||||
"""The UI uses this to avoid having to ask the API anything about the IdP. It already knows the SAML IdP ID from the path, so it can just link to this path and rely on the API to redirect to the actual IdP.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
provider_id=provider_id,
|
||||
callback_url=callback_url,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
119
kittycad/api/hidden/post_auth_saml.py
Normal file
119
kittycad/api/hidden/post_auth_saml.py
Normal file
@ -0,0 +1,119 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
provider_id: Uuid,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/auth/saml/provider/{provider_id}/login".format(
|
||||
client.base_url,
|
||||
provider_id=provider_id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body,
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
provider_id: Uuid,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
provider_id=provider_id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
provider_id: Uuid,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
|
||||
return sync_detailed(
|
||||
provider_id=provider_id,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
provider_id: Uuid,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
provider_id=provider_id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
provider_id: Uuid,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
provider_id=provider_id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
104
kittycad/api/meta/create_debug_uploads.py
Normal file
104
kittycad/api/meta/create_debug_uploads.py
Normal file
@ -0,0 +1,104 @@
|
||||
from typing import Any, Dict, List, 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 = "{}/debug/uploads".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[str], Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = [str(**item) for item in 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[List[str], 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[str], Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[List[str], Error]]:
|
||||
"""Do NOT send files here that you don't want to be public.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[List[str], Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[List[str], Error]]:
|
||||
"""Do NOT send files here that you don't want to be public.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
111
kittycad/api/meta/create_event.py
Normal file
111
kittycad/api/meta/create_event.py
Normal file
@ -0,0 +1,111 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.event import Event
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: Event,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/events".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: Event,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: Event,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""We collect anonymous telemetry data for improving our product.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: Event,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: Event,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""We collect anonymous telemetry data for improving our product.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -3,8 +3,8 @@ from typing import Any, Dict, Optional, Union
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.ai_plugin_manifest import AiPluginManifest
|
||||
from ...models.error import Error
|
||||
from ...models.ip_addr_info import IpAddrInfo
|
||||
from ...types import Response
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/.well-known/ai-plugin.json".format(
|
||||
url = "{}/_meta/ipinfo".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
@ -27,11 +27,9 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[AiPluginManifest, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[IpAddrInfo, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = AiPluginManifest(**response.json())
|
||||
response_200 = IpAddrInfo(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
@ -44,7 +42,7 @@ def _parse_response(
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[AiPluginManifest, Error]]]:
|
||||
) -> Response[Optional[Union[IpAddrInfo, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -56,7 +54,7 @@ def _build_response(
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[AiPluginManifest, Error]]]:
|
||||
) -> Response[Optional[Union[IpAddrInfo, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
@ -72,7 +70,8 @@ def sync_detailed(
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[AiPluginManifest, Error]]:
|
||||
) -> Optional[Union[IpAddrInfo, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
@ -81,7 +80,7 @@ def sync(
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[AiPluginManifest, Error]]]:
|
||||
) -> Response[Optional[Union[IpAddrInfo, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
@ -95,7 +94,8 @@ async def asyncio_detailed(
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[AiPluginManifest, Error]]:
|
||||
) -> Optional[Union[IpAddrInfo, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
@ -11,7 +11,7 @@ def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/openai/openapi.json".format(
|
||||
url = "{}/pricing/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
@ -70,7 +70,7 @@ def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[dict, Error]]:
|
||||
"""This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501
|
||||
"""This is the ultimate source of truth for the pricing of our subscriptions.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
@ -95,7 +95,7 @@ async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[dict, Error]]:
|
||||
"""This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars.""" # noqa: E501
|
||||
"""This is the ultimate source of truth for the pricing of our subscriptions.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
@ -70,6 +70,7 @@ def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[dict, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
@ -93,6 +94,7 @@ async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[dict, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
|
@ -71,6 +71,7 @@ def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Pong, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
@ -94,6 +95,7 @@ async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Pong, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
|
@ -1 +1 @@
|
||||
""" Contains methods for accessing the modeling API paths: Modeling API for updating your 3D files using the KittyCAD engine. """ # noqa: E501
|
||||
""" Contains methods for accessing the modeling API paths: Modeling API for updating your 3D files using the Zoo engine. """ # noqa: E501
|
||||
|
@ -1,51 +1,81 @@
|
||||
import json
|
||||
from typing import Any, Dict, Iterator
|
||||
from typing import Any, Dict, Iterator, Optional
|
||||
|
||||
import bson
|
||||
from websockets.client import WebSocketClientProtocol, connect as ws_connect_async
|
||||
from websockets.sync.client import ClientConnection, connect as ws_connect
|
||||
|
||||
from ...client import Client
|
||||
from ...models.post_effect_type import PostEffectType
|
||||
from ...models.web_socket_request import WebSocketRequest
|
||||
from ...models.web_socket_response import WebSocketResponse
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
fps: int,
|
||||
post_effect: PostEffectType,
|
||||
show_grid: bool,
|
||||
unlocked_framerate: bool,
|
||||
video_res_height: int,
|
||||
video_res_width: int,
|
||||
webrtc: bool,
|
||||
*,
|
||||
client: Client,
|
||||
pool: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/ws/modeling/commands".format(client.base_url) # noqa: E501
|
||||
|
||||
if fps is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&fps=" + str(fps)
|
||||
else:
|
||||
url = url + "?fps=" + str(fps)
|
||||
|
||||
if pool is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&pool=" + str(pool)
|
||||
else:
|
||||
url = url + "?pool=" + str(pool)
|
||||
|
||||
if post_effect is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&post_effect=" + str(post_effect)
|
||||
else:
|
||||
url = url + "?post_effect=" + str(post_effect)
|
||||
|
||||
if show_grid is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&show_grid=" + str(show_grid).lower()
|
||||
else:
|
||||
url = url + "?show_grid=" + str(show_grid).lower()
|
||||
|
||||
if unlocked_framerate is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&unlocked_framerate=" + str(unlocked_framerate).lower()
|
||||
else:
|
||||
url = url + "?unlocked_framerate=" + str(unlocked_framerate).lower()
|
||||
|
||||
if video_res_height is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&video_res_height=" + str(video_res_height)
|
||||
else:
|
||||
url = url + "?video_res_height=" + str(video_res_height)
|
||||
|
||||
if video_res_width is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&video_res_width=" + str(video_res_width)
|
||||
else:
|
||||
url = url + "?video_res_width=" + str(video_res_width)
|
||||
|
||||
if webrtc is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&webrtc=" + str(webrtc).lower()
|
||||
else:
|
||||
@ -64,17 +94,23 @@ def _get_kwargs(
|
||||
|
||||
def sync(
|
||||
fps: int,
|
||||
post_effect: PostEffectType,
|
||||
show_grid: bool,
|
||||
unlocked_framerate: bool,
|
||||
video_res_height: int,
|
||||
video_res_width: int,
|
||||
webrtc: bool,
|
||||
*,
|
||||
client: Client,
|
||||
pool: Optional[str] = None,
|
||||
) -> ClientConnection:
|
||||
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
fps=fps,
|
||||
pool=pool,
|
||||
post_effect=post_effect,
|
||||
show_grid=show_grid,
|
||||
unlocked_framerate=unlocked_framerate,
|
||||
video_res_height=video_res_height,
|
||||
video_res_width=video_res_width,
|
||||
@ -87,17 +123,23 @@ def sync(
|
||||
|
||||
async def asyncio(
|
||||
fps: int,
|
||||
post_effect: PostEffectType,
|
||||
show_grid: bool,
|
||||
unlocked_framerate: bool,
|
||||
video_res_height: int,
|
||||
video_res_width: int,
|
||||
webrtc: bool,
|
||||
*,
|
||||
client: Client,
|
||||
pool: Optional[str] = None,
|
||||
) -> WebSocketClientProtocol:
|
||||
"""Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.""" # noqa: E501
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
fps=fps,
|
||||
pool=pool,
|
||||
post_effect=post_effect,
|
||||
show_grid=show_grid,
|
||||
unlocked_framerate=unlocked_framerate,
|
||||
video_res_height=video_res_height,
|
||||
video_res_width=video_res_width,
|
||||
@ -121,19 +163,25 @@ class WebSocket:
|
||||
def __init__(
|
||||
self,
|
||||
fps: int,
|
||||
post_effect: PostEffectType,
|
||||
show_grid: bool,
|
||||
unlocked_framerate: bool,
|
||||
video_res_height: int,
|
||||
video_res_width: int,
|
||||
webrtc: bool,
|
||||
client: Client,
|
||||
pool: Optional[str] = None,
|
||||
):
|
||||
self.ws = sync(
|
||||
fps,
|
||||
post_effect,
|
||||
show_grid,
|
||||
unlocked_framerate,
|
||||
video_res_height,
|
||||
video_res_width,
|
||||
webrtc,
|
||||
client=client,
|
||||
pool=pool,
|
||||
)
|
||||
|
||||
def __enter__(
|
||||
|
1
kittycad/api/orgs/__init__.py
Normal file
1
kittycad/api/orgs/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the orgs API paths: An organization is a group of users of the Zoo API. Here, we can add users to an org and perform operations on orgs. """ # noqa: E501
|
116
kittycad/api/orgs/create_org.py
Normal file
116
kittycad/api/orgs/create_org.py
Normal file
@ -0,0 +1,116 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.org import Org
|
||||
from ...models.org_details import OrgDetails
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = Org(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo user that is not already in an org. It creates a new org for the authenticated user and makes them an admin.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo user that is not already in an org. It creates a new org for the authenticated user and makes them an admin.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
126
kittycad/api/orgs/create_org_member.py
Normal file
126
kittycad/api/orgs/create_org_member.py
Normal file
@ -0,0 +1,126 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.add_org_member import AddOrgMember
|
||||
from ...models.error import Error
|
||||
from ...models.org_member import OrgMember
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: AddOrgMember,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/members".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[OrgMember, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = OrgMember(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: AddOrgMember,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: AddOrgMember,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[OrgMember, Error]]:
|
||||
"""If the user exists, this will add them to your org. If they do not exist, this will create a new user and add them to your org.
|
||||
In both cases the user gets an email that they have been added to the org.
|
||||
If the user is already in your org, this will return a 400 and a message.
|
||||
If the user is already in a different org, this will return a 400 and a message.
|
||||
This endpoint requires authentication by an org admin. It adds the specified member to the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: AddOrgMember,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: AddOrgMember,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[OrgMember, Error]]:
|
||||
"""If the user exists, this will add them to your org. If they do not exist, this will create a new user and add them to your org.
|
||||
In both cases the user gets an email that they have been added to the org.
|
||||
If the user is already in your org, this will return a 400 and a message.
|
||||
If the user is already in a different org, this will return a 400 and a message.
|
||||
This endpoint requires authentication by an org admin. It adds the specified member to the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
118
kittycad/api/orgs/create_org_saml_idp.py
Normal file
118
kittycad/api/orgs/create_org_saml_idp.py
Normal file
@ -0,0 +1,118 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.saml_identity_provider import SamlIdentityProvider
|
||||
from ...models.saml_identity_provider_create import SamlIdentityProviderCreate
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/saml/idp".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = SamlIdentityProvider(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
106
kittycad/api/orgs/delete_org.py
Normal file
106
kittycad/api/orgs/delete_org.py
Normal file
@ -0,0 +1,106 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.delete(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""In order to delete an org, you must first delete all of its members, except yourself.
|
||||
You must also have no outstanding invoices or unpaid balances.
|
||||
This endpoint requires authentication by an org admin. It deletes the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.delete(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""In order to delete an org, you must first delete all of its members, except yourself.
|
||||
You must also have no outstanding invoices or unpaid balances.
|
||||
This endpoint requires authentication by an org admin. It deletes the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
111
kittycad/api/orgs/delete_org_member.py
Normal file
111
kittycad/api/orgs/delete_org_member.py
Normal file
@ -0,0 +1,111 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/members/{user_id}".format(
|
||||
client.base_url,
|
||||
user_id=user_id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.delete(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It removes the specified member from the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.delete(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It removes the specified member from the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
100
kittycad/api/orgs/delete_org_saml_idp.py
Normal file
100
kittycad/api/orgs/delete_org_saml_idp.py
Normal file
@ -0,0 +1,100 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/saml/idp".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.delete(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.delete(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
116
kittycad/api/orgs/get_any_org.py
Normal file
116
kittycad/api/orgs/get_any_org.py
Normal file
@ -0,0 +1,116 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.org import Org
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/orgs/{id}".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Org(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It gets the information for the specified org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It gets the information for the specified org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
105
kittycad/api/orgs/get_org.py
Normal file
105
kittycad/api/orgs/get_org.py
Normal file
@ -0,0 +1,105 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.org import Org
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Org(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
116
kittycad/api/orgs/get_org_member.py
Normal file
116
kittycad/api/orgs/get_org_member.py
Normal file
@ -0,0 +1,116 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.org_member import OrgMember
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/members/{user_id}".format(
|
||||
client.base_url,
|
||||
user_id=user_id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[OrgMember, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = OrgMember(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[OrgMember, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the specified member of the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
user_id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[OrgMember, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the specified member of the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
user_id=user_id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/orgs/get_org_privacy_settings.py
Normal file
107
kittycad/api/orgs/get_org_privacy_settings.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.privacy_settings import PrivacySettings
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/privacy".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[PrivacySettings, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PrivacySettings(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[PrivacySettings, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[PrivacySettings, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[PrivacySettings, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the privacy settings for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[PrivacySettings, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[PrivacySettings, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the privacy settings for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/orgs/get_org_saml_idp.py
Normal file
107
kittycad/api/orgs/get_org_saml_idp.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.saml_identity_provider import SamlIdentityProvider
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/saml/idp".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = SamlIdentityProvider(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/orgs/get_user_org.py
Normal file
107
kittycad/api/orgs/get_user_org.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.user_org_info import UserOrgInfo
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/org".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[UserOrgInfo, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = UserOrgInfo(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[UserOrgInfo, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[UserOrgInfo, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[UserOrgInfo, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It gets the authenticated user's org.
|
||||
If the user is not a member of an org, this endpoint will return a 404.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[UserOrgInfo, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[UserOrgInfo, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It gets the authenticated user's org.
|
||||
If the user is not a member of an org, this endpoint will return a 404.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
173
kittycad/api/orgs/list_org_members.py
Normal file
173
kittycad/api/orgs/list_org_members.py
Normal file
@ -0,0 +1,173 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...models.error import Error
|
||||
from ...models.org_member_results_page import OrgMemberResultsPage
|
||||
from ...models.user_org_role import UserOrgRole
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
sort_by: CreatedAtSortMode,
|
||||
role: UserOrgRole,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/members".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
if role is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&role=" + str(role)
|
||||
else:
|
||||
url = url + "?role=" + str(role)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[OrgMemberResultsPage, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = OrgMemberResultsPage(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[OrgMemberResultsPage, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
role: UserOrgRole,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[OrgMemberResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
role=role,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
sort_by: CreatedAtSortMode,
|
||||
role: UserOrgRole,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[OrgMemberResultsPage, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It lists the members of the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
role=role,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
role: UserOrgRole,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[OrgMemberResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
role=role,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
sort_by: CreatedAtSortMode,
|
||||
role: UserOrgRole,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[OrgMemberResultsPage, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It lists the members of the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
role=role,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
156
kittycad/api/orgs/list_orgs.py
Normal file
156
kittycad/api/orgs/list_orgs.py
Normal file
@ -0,0 +1,156 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...models.error import Error
|
||||
from ...models.org_results_page import OrgResultsPage
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/orgs".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[OrgResultsPage, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = OrgResultsPage(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[OrgResultsPage, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[OrgResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[OrgResultsPage, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. The orgs are returned in order of creation, with the most recently created orgs first.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[OrgResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[OrgResultsPage, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. The orgs are returned in order of creation, with the most recently created orgs first.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
129
kittycad/api/orgs/update_enterprise_pricing_for_org.py
Normal file
129
kittycad/api/orgs/update_enterprise_pricing_for_org.py
Normal file
@ -0,0 +1,129 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.subscription_tier_price import SubscriptionTierPrice
|
||||
from ...models.uuid import Uuid
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: Uuid,
|
||||
body: SubscriptionTierPrice,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/orgs/{id}/enterprise/pricing".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ZooProductSubscriptions(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: Uuid,
|
||||
body: SubscriptionTierPrice,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: Uuid,
|
||||
body: SubscriptionTierPrice,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""You must be a Zoo employee to perform this request.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: Uuid,
|
||||
body: SubscriptionTierPrice,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: Uuid,
|
||||
body: SubscriptionTierPrice,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""You must be a Zoo employee to perform this request.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
116
kittycad/api/orgs/update_org.py
Normal file
116
kittycad/api/orgs/update_org.py
Normal file
@ -0,0 +1,116 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.org import Org
|
||||
from ...models.org_details import OrgDetails
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Org, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Org(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Org, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: OrgDetails,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Org, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
127
kittycad/api/orgs/update_org_member.py
Normal file
127
kittycad/api/orgs/update_org_member.py
Normal file
@ -0,0 +1,127 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.org_member import OrgMember
|
||||
from ...models.update_member_to_org_body import UpdateMemberToOrgBody
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
user_id: Uuid,
|
||||
body: UpdateMemberToOrgBody,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/members/{user_id}".format(
|
||||
client.base_url,
|
||||
user_id=user_id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[OrgMember, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = OrgMember(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
user_id: Uuid,
|
||||
body: UpdateMemberToOrgBody,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
user_id=user_id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
user_id: Uuid,
|
||||
body: UpdateMemberToOrgBody,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[OrgMember, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the specified member of the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
user_id=user_id,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
user_id: Uuid,
|
||||
body: UpdateMemberToOrgBody,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[OrgMember, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
user_id=user_id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
user_id: Uuid,
|
||||
body: UpdateMemberToOrgBody,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[OrgMember, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the specified member of the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
user_id=user_id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
117
kittycad/api/orgs/update_org_privacy_settings.py
Normal file
117
kittycad/api/orgs/update_org_privacy_settings.py
Normal file
@ -0,0 +1,117 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.privacy_settings import PrivacySettings
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: PrivacySettings,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/privacy".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[PrivacySettings, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PrivacySettings(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[PrivacySettings, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: PrivacySettings,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[PrivacySettings, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: PrivacySettings,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[PrivacySettings, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the privacy settings for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: PrivacySettings,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[PrivacySettings, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: PrivacySettings,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[PrivacySettings, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the privacy settings for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
118
kittycad/api/orgs/update_org_saml_idp.py
Normal file
118
kittycad/api/orgs/update_org_saml_idp.py
Normal file
@ -0,0 +1,118 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.saml_identity_provider import SamlIdentityProvider
|
||||
from ...models.saml_identity_provider_create import SamlIdentityProviderCreate
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/saml/idp".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = SamlIdentityProvider(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[SamlIdentityProvider, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: SamlIdentityProviderCreate,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[SamlIdentityProvider, Error]]:
|
||||
"""This endpoint requires authentication by an org admin.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
120
kittycad/api/payments/create_org_subscription.py
Normal file
120
kittycad/api/payments/create_org_subscription.py
Normal file
@ -0,0 +1,120 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...models.zoo_product_subscriptions_org_request import (
|
||||
ZooProductSubscriptionsOrgRequest,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ZooProductSubscriptions(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It creates the subscription for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It creates the subscription for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
120
kittycad/api/payments/create_payment_information_for_org.py
Normal file
120
kittycad/api/payments/create_payment_information_for_org.py
Normal file
@ -0,0 +1,120 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.billing_info import BillingInfo
|
||||
from ...models.customer import Customer
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = Customer(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Customer, Error]]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by the org admin. It creates the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Customer, Error]]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by the org admin. It creates the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -26,7 +26,7 @@ def _get_kwargs(
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body,
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
|
107
kittycad/api/payments/create_payment_intent_for_org.py
Normal file
107
kittycad/api/payments/create_payment_intent_for_org.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.payment_intent import PaymentIntent
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/intent".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[PaymentIntent, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = PaymentIntent(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[PaymentIntent, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[PaymentIntent, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[PaymentIntent, Error]]:
|
||||
"""This endpoint requires authentication by the org admin. It creates a new payment intent for the authenticated user's org's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[PaymentIntent, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[PaymentIntent, Error]]:
|
||||
"""This endpoint requires authentication by the org admin. It creates a new payment intent for the authenticated user's org's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
120
kittycad/api/payments/create_user_subscription.py
Normal file
120
kittycad/api/payments/create_user_subscription.py
Normal file
@ -0,0 +1,120 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...models.zoo_product_subscriptions_user_request import (
|
||||
ZooProductSubscriptionsUserRequest,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/payment/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ZooProductSubscriptions(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It creates the subscription for the user.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It creates the subscription for the user.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
104
kittycad/api/payments/delete_payment_information_for_org.py
Normal file
104
kittycad/api/payments/delete_payment_information_for_org.py
Normal file
@ -0,0 +1,104 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.delete(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by an org admin. It deletes the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.delete(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by an org admin. It deletes the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
110
kittycad/api/payments/delete_payment_method_for_org.py
Normal file
110
kittycad/api/payments/delete_payment_method_for_org.py
Normal file
@ -0,0 +1,110 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/methods/{id}".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.delete(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It deletes the specified payment method for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.delete(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It deletes the specified payment method for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/payments/get_org_subscription.py
Normal file
107
kittycad/api/payments/get_org_subscription.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ZooProductSubscriptions(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the subscription for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the subscription for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
118
kittycad/api/payments/get_payment_balance_for_any_org.py
Normal file
118
kittycad/api/payments/get_payment_balance_for_any_org.py
Normal file
@ -0,0 +1,118 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.customer_balance import CustomerBalance
|
||||
from ...models.error import Error
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/orgs/{id}/payment/balance".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CustomerBalance(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
118
kittycad/api/payments/get_payment_balance_for_any_user.py
Normal file
118
kittycad/api/payments/get_payment_balance_for_any_user.py
Normal file
@ -0,0 +1,118 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.customer_balance import CustomerBalance
|
||||
from ...models.error import Error
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/users/{id}/payment/balance".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CustomerBalance(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified user.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: Uuid,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It gets the balance information for the specified user.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/payments/get_payment_balance_for_org.py
Normal file
107
kittycad/api/payments/get_payment_balance_for_org.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.customer_balance import CustomerBalance
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/balance".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CustomerBalance(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the balance information for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It gets the balance information for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
109
kittycad/api/payments/get_payment_information_for_org.py
Normal file
109
kittycad/api/payments/get_payment_information_for_org.py
Normal file
@ -0,0 +1,109 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.customer import Customer
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Customer(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Customer, Error]]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by an org admin. It gets the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Customer, Error]]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by an org admin. It gets the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/payments/get_user_subscription.py
Normal file
107
kittycad/api/payments/get_user_subscription.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/payment/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ZooProductSubscriptions(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It gets the subscription for the user.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It gets the subscription for the user.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/payments/list_invoices_for_org.py
Normal file
107
kittycad/api/payments/list_invoices_for_org.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.invoice import Invoice
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/invoices".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[List[Invoice], Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = [Invoice(**item) for item in response.json()]
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[List[Invoice], Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[List[Invoice], Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[List[Invoice], Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It lists invoices for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[List[Invoice], Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[List[Invoice], Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It lists invoices for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
107
kittycad/api/payments/list_payment_methods_for_org.py
Normal file
107
kittycad/api/payments/list_payment_methods_for_org.py
Normal file
@ -0,0 +1,107 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.payment_method import PaymentMethod
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/methods".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[List[PaymentMethod], Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = [PaymentMethod(**item) for item in response.json()]
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[List[PaymentMethod], Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It lists payment methods for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[List[PaymentMethod], Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[List[PaymentMethod], Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It lists payment methods for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
120
kittycad/api/payments/update_org_subscription.py
Normal file
120
kittycad/api/payments/update_org_subscription.py
Normal file
@ -0,0 +1,120 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...models.zoo_product_subscriptions_org_request import (
|
||||
ZooProductSubscriptionsOrgRequest,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ZooProductSubscriptions(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the subscription for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: ZooProductSubscriptionsOrgRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It updates the subscription for the authenticated user's org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
129
kittycad/api/payments/update_payment_balance_for_any_org.py
Normal file
129
kittycad/api/payments/update_payment_balance_for_any_org.py
Normal file
@ -0,0 +1,129 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.customer_balance import CustomerBalance
|
||||
from ...models.error import Error
|
||||
from ...models.update_payment_balance import UpdatePaymentBalance
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/orgs/{id}/payment/balance".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CustomerBalance(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified org.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified org.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
129
kittycad/api/payments/update_payment_balance_for_any_user.py
Normal file
129
kittycad/api/payments/update_payment_balance_for_any_user.py
Normal file
@ -0,0 +1,129 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.customer_balance import CustomerBalance
|
||||
from ...models.error import Error
|
||||
from ...models.update_payment_balance import UpdatePaymentBalance
|
||||
from ...models.uuid import Uuid
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/users/{id}/payment/balance".format(
|
||||
client.base_url,
|
||||
id=id,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = CustomerBalance(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified user.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[CustomerBalance, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: Uuid,
|
||||
body: UpdatePaymentBalance,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[CustomerBalance, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It updates the balance information for the specified user.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
120
kittycad/api/payments/update_payment_information_for_org.py
Normal file
120
kittycad/api/payments/update_payment_information_for_org.py
Normal file
@ -0,0 +1,120 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.billing_info import BillingInfo
|
||||
from ...models.customer import Customer
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Customer(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Customer, Error]]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by an org admin. It updates the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[Customer, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: BillingInfo,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Customer, Error]]:
|
||||
"""This includes billing address, phone, and name.
|
||||
This endpoint requires authentication by an org admin. It updates the payment information for the authenticated user's org.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -26,7 +26,7 @@ def _get_kwargs(
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body,
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
|
120
kittycad/api/payments/update_user_subscription.py
Normal file
120
kittycad/api/payments/update_user_subscription.py
Normal file
@ -0,0 +1,120 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.zoo_product_subscriptions import ZooProductSubscriptions
|
||||
from ...models.zoo_product_subscriptions_user_request import (
|
||||
ZooProductSubscriptionsUserRequest,
|
||||
)
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/payment/subscriptions".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ZooProductSubscriptions(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.put(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It updates the subscription for the user.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ZooProductSubscriptions, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.put(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: ZooProductSubscriptionsUserRequest,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ZooProductSubscriptions, Error]]:
|
||||
"""This endpoint requires authentication by any Zoo user. It updates the subscription for the user.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -0,0 +1,100 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/payment/tax".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It will return an error if the org's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It will return an error if the org's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -66,7 +66,7 @@ def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by any Zoo user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
|
||||
"""This endpoint requires authentication by any Zoo user. It will return an error if the user's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
@ -91,7 +91,7 @@ async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by any Zoo user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
|
||||
"""This endpoint requires authentication by any Zoo user. It will return an error if the user's information is not valid for automatic tax. Otherwise, it will return an empty successful response.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
|
1
kittycad/api/service_accounts/__init__.py
Normal file
1
kittycad/api/service_accounts/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the service_accounts API paths: Service accounts allow organizations to call the API. Organization admins can create, delete, and list the service accounts for their org. Service accounts are scoped to an organization not individual users, these are better to use for automations than individual API tokens, since they won't stop working when an individual leaves the company. """ # noqa: E501
|
123
kittycad/api/service_accounts/create_service_account_for_org.py
Normal file
123
kittycad/api/service_accounts/create_service_account_for_org.py
Normal file
@ -0,0 +1,123 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.service_account import ServiceAccount
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/service-accounts".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if label is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&label=" + str(label)
|
||||
else:
|
||||
url = url + "?label=" + str(label)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ServiceAccount(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
label=label,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It creates a new service account for the organization.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
label=label,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
label=label,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
label: Optional[str] = None,
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It creates a new service account for the organization.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
label=label,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
114
kittycad/api/service_accounts/delete_service_account_for_org.py
Normal file
114
kittycad/api/service_accounts/delete_service_account_for_org.py
Normal file
@ -0,0 +1,114 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/service-accounts/{token}".format(
|
||||
client.base_url,
|
||||
token=token,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
|
||||
return None
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
token=token,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.delete(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.
|
||||
This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
token=token,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
token=token,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.delete(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Error]:
|
||||
"""This endpoint requires authentication by an org admin. It deletes the requested service account for the organization.
|
||||
This endpoint does not actually delete the service account from the database. It merely marks the token as invalid. We still want to keep the service account in the database for historical purposes.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
token=token,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
117
kittycad/api/service_accounts/get_service_account_for_org.py
Normal file
117
kittycad/api/service_accounts/get_service_account_for_org.py
Normal file
@ -0,0 +1,117 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...models.service_account import ServiceAccount
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/service-accounts/{token}".format(
|
||||
client.base_url,
|
||||
token=token,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ServiceAccount(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
token=token,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
token=token,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[ServiceAccount, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
token=token,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[ServiceAccount, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It returns details of the requested service account for the organization.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
token=token,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
160
kittycad/api/service_accounts/list_service_accounts_for_org.py
Normal file
160
kittycad/api/service_accounts/list_service_accounts_for_org.py
Normal file
@ -0,0 +1,160 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...models.error import Error
|
||||
from ...models.service_account_results_page import ServiceAccountResultsPage
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/org/service-accounts".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
if limit is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&limit=" + str(limit)
|
||||
else:
|
||||
url = url + "?limit=" + str(limit)
|
||||
|
||||
if page_token is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&page_token=" + str(page_token)
|
||||
else:
|
||||
url = url + "?page_token=" + str(page_token)
|
||||
|
||||
if sort_by is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&sort_by=" + str(sort_by)
|
||||
else:
|
||||
url = url + "?sort_by=" + str(sort_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[ServiceAccountResultsPage, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ServiceAccountResultsPage(**response.json())
|
||||
return response_200
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[ServiceAccountResultsPage, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ServiceAccountResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[ServiceAccountResultsPage, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It returns the service accounts for the organization.
|
||||
The service accounts are returned in order of creation, with the most recently created service accounts first.
|
||||
""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Optional[Union[ServiceAccountResultsPage, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[ServiceAccountResultsPage, Error]]:
|
||||
"""This endpoint requires authentication by an org admin. It returns the service accounts for the organization.
|
||||
The service accounts are returned in order of creation, with the most recently created service accounts first.
|
||||
""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
1
kittycad/api/store/__init__.py
Normal file
1
kittycad/api/store/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the store API paths: Operations involving our swag store. """ # noqa: E501
|
118
kittycad/api/store/create_store_coupon.py
Normal file
118
kittycad/api/store/create_store_coupon.py
Normal file
@ -0,0 +1,118 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.discount_code import DiscountCode
|
||||
from ...models.error import Error
|
||||
from ...models.store_coupon_params import StoreCouponParams
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
body: StoreCouponParams,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/store/coupon".format(
|
||||
client.base_url,
|
||||
) # noqa: E501
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
"content": body.model_dump_json(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, response: httpx.Response
|
||||
) -> Optional[Union[DiscountCode, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = DiscountCode(**response.json())
|
||||
return response_201
|
||||
if response.status_code == 400:
|
||||
response_4XX = Error(**response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error(**response.json())
|
||||
return response_5XX
|
||||
return Error(**response.json())
|
||||
|
||||
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[DiscountCode, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
body: StoreCouponParams,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[DiscountCode, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
body: StoreCouponParams,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[DiscountCode, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It creates a new store coupon.""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
body: StoreCouponParams,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Optional[Union[DiscountCode, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.post(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
body: StoreCouponParams,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[DiscountCode, Error]]:
|
||||
"""This endpoint requires authentication by a Zoo employee. It creates a new store coupon.""" # noqa: E501
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -23,6 +23,7 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if value is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&value=" + str(value)
|
||||
else:
|
||||
|
@ -23,6 +23,7 @@ def _get_kwargs(
|
||||
) # noqa: E501
|
||||
|
||||
if value is not None:
|
||||
|
||||
if "?" in url:
|
||||
url = url + "&value=" + str(value)
|
||||
else:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user