Merge pull request #22 from KittyCAD/update-spec-v0.1.4
Update go lang spec docs for v0.1.4
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,3 +23,4 @@ dmypy.json
|
|||||||
/.coverage
|
/.coverage
|
||||||
|
|
||||||
poetry.lock
|
poetry.lock
|
||||||
|
testing
|
||||||
|
3
Makefile
3
Makefile
@ -16,12 +16,13 @@ generate: docker-image ## Generate the api client.
|
|||||||
--disable-content-trust \
|
--disable-content-trust \
|
||||||
-v $(CURDIR):/usr/src \
|
-v $(CURDIR):/usr/src \
|
||||||
--workdir /usr/src \
|
--workdir /usr/src \
|
||||||
$(DOCKER_IMAGE_NAME) sh -c 'poetry run python generate/generate.py && poetry run autopep8 --in-place --aggressive --aggressive kittycad/models/*.py && poetry run autopep8 --in-place --aggressive --aggressive kittycad/api/*.py && poetry run autopep8 --in-place --aggressive --aggressive kittycad/*.py && poetry run autopep8 --in-place --aggressive --aggressive generate/*.py'
|
$(DOCKER_IMAGE_NAME) ./generate/run.sh
|
||||||
|
|
||||||
.PHONY: shell
|
.PHONY: shell
|
||||||
shell: docker-image ## Pop into a shell in the docker image.
|
shell: docker-image ## Pop into a shell in the docker image.
|
||||||
docker run --rm -i $(DOCKER_FLAGS) \
|
docker run --rm -i $(DOCKER_FLAGS) \
|
||||||
--name python-generator-shell \
|
--name python-generator-shell \
|
||||||
|
--disable-content-trust \
|
||||||
-v $(CURDIR):/usr/src \
|
-v $(CURDIR):/usr/src \
|
||||||
--workdir /usr/src \
|
--workdir /usr/src \
|
||||||
$(DOCKER_IMAGE_NAME) /bin/bash
|
$(DOCKER_IMAGE_NAME) /bin/bash
|
||||||
|
@ -82,6 +82,9 @@ def generatePaths(cwd: str, parser: dict) -> dict:
|
|||||||
paths = data['paths']
|
paths = data['paths']
|
||||||
for p in paths:
|
for p in paths:
|
||||||
for method in paths[p]:
|
for method in paths[p]:
|
||||||
|
print('METHOD: ', method.upper())
|
||||||
|
# Skip OPTIONS.
|
||||||
|
if method.upper() != 'OPTIONS':
|
||||||
endpoint = paths[p][method]
|
endpoint = paths[p][method]
|
||||||
data = generatePath(path, p, method, endpoint, data)
|
data = generatePath(path, p, method, endpoint, data)
|
||||||
|
|
||||||
@ -107,12 +110,12 @@ def generatePath(
|
|||||||
print(" endpoint: ", [endpoint])
|
print(" endpoint: ", [endpoint])
|
||||||
f = open(file_path, "w")
|
f = open(file_path, "w")
|
||||||
|
|
||||||
endoint_refs = getEndpointRefs(endpoint, data)
|
endpoint_refs = getEndpointRefs(endpoint, data)
|
||||||
parameter_refs = getParameterRefs(endpoint)
|
parameter_refs = getParameterRefs(endpoint)
|
||||||
request_body_refs = getRequestBodyRefs(endpoint)
|
request_body_refs = getRequestBodyRefs(endpoint)
|
||||||
request_body_type = getRequestBodyType(endpoint)
|
request_body_type = getRequestBodyType(endpoint)
|
||||||
|
|
||||||
success_type = endoint_refs[0]
|
success_type = endpoint_refs[0]
|
||||||
|
|
||||||
if fn_name == 'get_file_conversion' or fn_name == 'create_file_conversion':
|
if fn_name == 'get_file_conversion' or fn_name == 'create_file_conversion':
|
||||||
fn_name += '_with_base64_helper'
|
fn_name += '_with_base64_helper'
|
||||||
@ -170,7 +173,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("from ...client import Client\n")
|
f.write("from ...client import Client\n")
|
||||||
# Import our references for responses.
|
# Import our references for responses.
|
||||||
for ref in endoint_refs:
|
for ref in endpoint_refs:
|
||||||
if ref.startswith('[') and ref.endswith(']'):
|
if ref.startswith('[') and ref.endswith(']'):
|
||||||
ref = ref.replace('[', '').replace(']', '')
|
ref = ref.replace('[', '').replace(']', '')
|
||||||
f.write(
|
f.write(
|
||||||
@ -205,7 +208,9 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
parameter_name = parameter['name']
|
parameter_name = parameter['name']
|
||||||
if 'type' in parameter['schema']:
|
if 'type' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
parameter_type = parameter['schema']['type'].replace(
|
||||||
'string', 'str').replace('integer', 'int')
|
'string', 'str').replace(
|
||||||
|
'integer', 'int').replace(
|
||||||
|
'number', 'float')
|
||||||
elif '$ref' in parameter['schema']:
|
elif '$ref' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
parameter_type = parameter['schema']['$ref'].replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
@ -267,7 +272,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
"def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, " +
|
"def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, " +
|
||||||
", ".join(endoint_refs) +
|
", ".join(endpoint_refs) +
|
||||||
"]]:\n")
|
"]]:\n")
|
||||||
# Iterate over the responses.
|
# Iterate over the responses.
|
||||||
responses = endpoint['responses']
|
responses = endpoint['responses']
|
||||||
@ -279,6 +284,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
"XX",
|
"XX",
|
||||||
"00") +
|
"00") +
|
||||||
":\n")
|
":\n")
|
||||||
|
is_one_of = False
|
||||||
if 'content' in response:
|
if 'content' in response:
|
||||||
content = response['content']
|
content = response['content']
|
||||||
for content_type in content:
|
for content_type in content:
|
||||||
@ -286,6 +292,29 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
json = content[content_type]['schema']
|
json = content[content_type]['schema']
|
||||||
if '$ref' in json:
|
if '$ref' in json:
|
||||||
ref = json['$ref'].replace('#/components/schemas/', '')
|
ref = json['$ref'].replace('#/components/schemas/', '')
|
||||||
|
schema = data['components']['schemas'][ref]
|
||||||
|
# Let's check if it is a oneOf.
|
||||||
|
if 'oneOf' in schema:
|
||||||
|
is_one_of = True
|
||||||
|
# We want to parse each of the possible types.
|
||||||
|
f.write("\t\tdata = response.json()\n")
|
||||||
|
for index, one_of in enumerate(schema['oneOf']):
|
||||||
|
ref = one_of['$ref'].replace(
|
||||||
|
'#/components/schemas/', '')
|
||||||
|
f.write("\t\ttry:\n")
|
||||||
|
f.write(
|
||||||
|
"\t\t\tif not isinstance(data, dict):\n")
|
||||||
|
f.write("\t\t\t\traise TypeError()\n")
|
||||||
|
f.write(
|
||||||
|
"\t\t\toption = " + ref + ".from_dict(data)\n")
|
||||||
|
f.write("\t\t\treturn option\n")
|
||||||
|
f.write("\t\texcept:\n")
|
||||||
|
if index == len(schema['oneOf']) - 1:
|
||||||
|
# On the last one raise the error.
|
||||||
|
f.write("\t\t\traise\n")
|
||||||
|
else:
|
||||||
|
f.write("\t\t\tpass\n")
|
||||||
|
else:
|
||||||
f.write(
|
f.write(
|
||||||
"\t\tresponse_" +
|
"\t\tresponse_" +
|
||||||
response_code +
|
response_code +
|
||||||
@ -340,7 +369,11 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
else:
|
else:
|
||||||
f.write("\t\tresponse_" + response_code + " = None\n")
|
f.write("\t\tresponse_" + response_code + " = None\n")
|
||||||
|
|
||||||
f.write("\t\treturn response_" + response_code + "\n")
|
if not is_one_of:
|
||||||
|
f.write(
|
||||||
|
"\t\treturn response_" +
|
||||||
|
response_code +
|
||||||
|
"\n")
|
||||||
|
|
||||||
# End the method.
|
# End the method.
|
||||||
f.write("\treturn None\n")
|
f.write("\treturn None\n")
|
||||||
@ -350,7 +383,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write(
|
f.write(
|
||||||
"def _build_response(*, response: httpx.Response) -> Response[Union[Any, " +
|
"def _build_response(*, response: httpx.Response) -> Response[Union[Any, " +
|
||||||
", ".join(endoint_refs) +
|
", ".join(endpoint_refs) +
|
||||||
"]]:\n")
|
"]]:\n")
|
||||||
f.write("\treturn Response(\n")
|
f.write("\treturn Response(\n")
|
||||||
f.write("\t\tstatus_code=response.status_code,\n")
|
f.write("\t\tstatus_code=response.status_code,\n")
|
||||||
@ -371,7 +404,9 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
parameter_name = parameter['name']
|
parameter_name = parameter['name']
|
||||||
if 'type' in parameter['schema']:
|
if 'type' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
parameter_type = parameter['schema']['type'].replace(
|
||||||
'string', 'str').replace('integer', 'int')
|
'string', 'str').replace(
|
||||||
|
'integer', 'int').replace(
|
||||||
|
'number', 'float')
|
||||||
elif '$ref' in parameter['schema']:
|
elif '$ref' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
parameter_type = parameter['schema']['$ref'].replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
@ -392,32 +427,13 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
f.write("\t*,\n")
|
f.write("\t*,\n")
|
||||||
f.write("\tclient: Client,\n")
|
f.write("\tclient: Client,\n")
|
||||||
f.write(") -> Response[Union[Any, " +
|
f.write(") -> Response[Union[Any, " +
|
||||||
", ".join(endoint_refs) +
|
", ".join(endpoint_refs) +
|
||||||
"]]:\n")
|
"]]:\n")
|
||||||
f.write("\tkwargs = _get_kwargs(\n")
|
f.write("\tkwargs = _get_kwargs(\n")
|
||||||
# Iterate over the parameters.
|
params = get_function_parameters(endpoint, request_body_type)
|
||||||
if 'parameters' in endpoint:
|
for param in params:
|
||||||
parameters = endpoint['parameters']
|
|
||||||
for parameter in parameters:
|
|
||||||
parameter_name = parameter['name']
|
|
||||||
if 'type' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
|
||||||
'string', 'str').replace('integer', 'int')
|
|
||||||
elif '$ref' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
|
||||||
'#/components/schemas/', '')
|
|
||||||
else:
|
|
||||||
print(" parameter: ", parameter)
|
|
||||||
raise Exception("Unknown parameter type")
|
|
||||||
f.write(
|
f.write(
|
||||||
"\t\t" +
|
"\t\t" + param + "=" + param + ",\n")
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
"=" +
|
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
",\n")
|
|
||||||
if request_body_type:
|
|
||||||
f.write(
|
|
||||||
"\t\tbody=body,\n")
|
|
||||||
f.write("\t\tclient=client,\n")
|
f.write("\t\tclient=client,\n")
|
||||||
f.write("\t)\n")
|
f.write("\t)\n")
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
@ -440,7 +456,9 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
parameter_name = parameter['name']
|
parameter_name = parameter['name']
|
||||||
if 'type' in parameter['schema']:
|
if 'type' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
parameter_type = parameter['schema']['type'].replace(
|
||||||
'string', 'str').replace('integer', 'int')
|
'string', 'str').replace(
|
||||||
|
'integer', 'int').replace(
|
||||||
|
'number', 'float')
|
||||||
elif '$ref' in parameter['schema']:
|
elif '$ref' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
parameter_type = parameter['schema']['$ref'].replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
@ -461,35 +479,16 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
f.write("\t*,\n")
|
f.write("\t*,\n")
|
||||||
f.write("\tclient: Client,\n")
|
f.write("\tclient: Client,\n")
|
||||||
f.write(") -> Optional[Union[Any, " +
|
f.write(") -> Optional[Union[Any, " +
|
||||||
", ".join(endoint_refs) +
|
", ".join(endpoint_refs) +
|
||||||
"]]:\n")
|
"]]:\n")
|
||||||
if 'description' in endpoint:
|
if 'description' in endpoint:
|
||||||
f.write("\t\"\"\" " + endpoint['description'] + " \"\"\"\n")
|
f.write("\t\"\"\" " + endpoint['description'] + " \"\"\"\n")
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("\treturn sync_detailed(\n")
|
f.write("\treturn sync_detailed(\n")
|
||||||
# Iterate over the parameters.
|
params = get_function_parameters(endpoint, request_body_type)
|
||||||
if 'parameters' in endpoint:
|
for param in params:
|
||||||
parameters = endpoint['parameters']
|
|
||||||
for parameter in parameters:
|
|
||||||
parameter_name = parameter['name']
|
|
||||||
if 'type' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
|
||||||
'string', 'str').replace('integer', 'int')
|
|
||||||
elif '$ref' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
|
||||||
'#/components/schemas/', '')
|
|
||||||
else:
|
|
||||||
print(" parameter: ", parameter)
|
|
||||||
raise Exception("Unknown parameter type")
|
|
||||||
f.write(
|
f.write(
|
||||||
"\t\t" +
|
"\t\t" + param + "=" + param + ",\n")
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
"=" +
|
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
",\n")
|
|
||||||
if request_body_type:
|
|
||||||
f.write(
|
|
||||||
"\t\tbody=body,\n")
|
|
||||||
f.write("\t\tclient=client,\n")
|
f.write("\t\tclient=client,\n")
|
||||||
f.write("\t).parsed\n")
|
f.write("\t).parsed\n")
|
||||||
|
|
||||||
@ -505,7 +504,9 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
parameter_name = parameter['name']
|
parameter_name = parameter['name']
|
||||||
if 'type' in parameter['schema']:
|
if 'type' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
parameter_type = parameter['schema']['type'].replace(
|
||||||
'string', 'str').replace('integer', 'int')
|
'string', 'str').replace(
|
||||||
|
'integer', 'int').replace(
|
||||||
|
'number', 'float')
|
||||||
elif '$ref' in parameter['schema']:
|
elif '$ref' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
parameter_type = parameter['schema']['$ref'].replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
@ -526,32 +527,13 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
f.write("\t*,\n")
|
f.write("\t*,\n")
|
||||||
f.write("\tclient: Client,\n")
|
f.write("\tclient: Client,\n")
|
||||||
f.write(") -> Response[Union[Any, " +
|
f.write(") -> Response[Union[Any, " +
|
||||||
", ".join(endoint_refs) +
|
", ".join(endpoint_refs) +
|
||||||
"]]:\n")
|
"]]:\n")
|
||||||
f.write("\tkwargs = _get_kwargs(\n")
|
f.write("\tkwargs = _get_kwargs(\n")
|
||||||
# Iterate over the parameters.
|
params = get_function_parameters(endpoint, request_body_type)
|
||||||
if 'parameters' in endpoint:
|
for param in params:
|
||||||
parameters = endpoint['parameters']
|
|
||||||
for parameter in parameters:
|
|
||||||
parameter_name = parameter['name']
|
|
||||||
if 'type' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
|
||||||
'string', 'str').replace('integer', 'int')
|
|
||||||
elif '$ref' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
|
||||||
'#/components/schemas/', '')
|
|
||||||
else:
|
|
||||||
print(" parameter: ", parameter)
|
|
||||||
raise Exception("Unknown parameter type")
|
|
||||||
f.write(
|
f.write(
|
||||||
"\t\t" +
|
"\t\t" + param + "=" + param + ",\n")
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
"=" +
|
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
",\n")
|
|
||||||
if request_body_type:
|
|
||||||
f.write(
|
|
||||||
"\t\tbody=body,\n")
|
|
||||||
f.write("\t\tclient=client,\n")
|
f.write("\t\tclient=client,\n")
|
||||||
f.write("\t)\n")
|
f.write("\t)\n")
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
@ -572,7 +554,9 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
parameter_name = parameter['name']
|
parameter_name = parameter['name']
|
||||||
if 'type' in parameter['schema']:
|
if 'type' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
parameter_type = parameter['schema']['type'].replace(
|
||||||
'string', 'str').replace('integer', 'int')
|
'string', 'str').replace(
|
||||||
|
'integer', 'int').replace(
|
||||||
|
'number', 'float')
|
||||||
elif '$ref' in parameter['schema']:
|
elif '$ref' in parameter['schema']:
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
parameter_type = parameter['schema']['$ref'].replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
@ -593,36 +577,17 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
|||||||
f.write("\t*,\n")
|
f.write("\t*,\n")
|
||||||
f.write("\tclient: Client,\n")
|
f.write("\tclient: Client,\n")
|
||||||
f.write(") -> Optional[Union[Any, " +
|
f.write(") -> Optional[Union[Any, " +
|
||||||
", ".join(endoint_refs) +
|
", ".join(endpoint_refs) +
|
||||||
"]]:\n")
|
"]]:\n")
|
||||||
if 'description' in endpoint:
|
if 'description' in endpoint:
|
||||||
f.write("\t\"\"\" " + endpoint['description'] + " \"\"\"\n")
|
f.write("\t\"\"\" " + endpoint['description'] + " \"\"\"\n")
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("\treturn (\n")
|
f.write("\treturn (\n")
|
||||||
f.write("\t\tawait asyncio_detailed(\n")
|
f.write("\t\tawait asyncio_detailed(\n")
|
||||||
# Iterate over the parameters.
|
params = get_function_parameters(endpoint, request_body_type)
|
||||||
if 'parameters' in endpoint:
|
for param in params:
|
||||||
parameters = endpoint['parameters']
|
|
||||||
for parameter in parameters:
|
|
||||||
parameter_name = parameter['name']
|
|
||||||
if 'type' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['type'].replace(
|
|
||||||
'string', 'str').replace('integer', 'int')
|
|
||||||
elif '$ref' in parameter['schema']:
|
|
||||||
parameter_type = parameter['schema']['$ref'].replace(
|
|
||||||
'#/components/schemas/', '')
|
|
||||||
else:
|
|
||||||
print(" parameter: ", parameter)
|
|
||||||
raise Exception("Unknown parameter type")
|
|
||||||
f.write(
|
f.write(
|
||||||
"\t\t\t" +
|
"\t\t" + param + "=" + param + ",\n")
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
"=" +
|
|
||||||
camel_to_snake(parameter_name) +
|
|
||||||
",\n")
|
|
||||||
if request_body_type:
|
|
||||||
f.write(
|
|
||||||
"\t\t\tbody=body,\n")
|
|
||||||
f.write("\t\t\tclient=client,\n")
|
f.write("\t\t\tclient=client,\n")
|
||||||
f.write("\t\t)\n")
|
f.write("\t\t)\n")
|
||||||
f.write("\t).parsed\n")
|
f.write("\t).parsed\n")
|
||||||
@ -650,7 +615,9 @@ def generateTypes(cwd: str, parser: dict):
|
|||||||
schemas = data['components']['schemas']
|
schemas = data['components']['schemas']
|
||||||
for key in schemas:
|
for key in schemas:
|
||||||
schema = schemas[key]
|
schema = schemas[key]
|
||||||
|
print("generating schema: ", key)
|
||||||
generateType(path, key, schema)
|
generateType(path, key, schema)
|
||||||
|
if 'oneOf' not in schema:
|
||||||
f.write("from ." + camel_to_snake(key) + " import " + key + "\n")
|
f.write("from ." + camel_to_snake(key) + " import " + key + "\n")
|
||||||
|
|
||||||
# Close the file.
|
# Close the file.
|
||||||
@ -658,14 +625,123 @@ def generateTypes(cwd: str, parser: dict):
|
|||||||
|
|
||||||
|
|
||||||
def generateType(path: str, name: str, schema: dict):
|
def generateType(path: str, name: str, schema: dict):
|
||||||
|
file_path = path
|
||||||
|
if path.endswith(".py") is False:
|
||||||
# Generate the type.
|
# Generate the type.
|
||||||
file_name = camel_to_snake(name) + '.py'
|
file_name = camel_to_snake(name) + '.py'
|
||||||
file_path = os.path.join(path, file_name)
|
file_path = os.path.join(path, file_name)
|
||||||
|
|
||||||
|
if 'type' in schema:
|
||||||
type_name = schema['type']
|
type_name = schema['type']
|
||||||
print("generating type: ", name, " at: ", file_path)
|
|
||||||
print(" schema: ", [schema])
|
|
||||||
f = open(file_path, "w")
|
|
||||||
if type_name == 'object':
|
if type_name == 'object':
|
||||||
|
generateObjectType(file_path, name, schema, type_name)
|
||||||
|
elif type_name == 'string' and 'enum' in schema:
|
||||||
|
generateEnumType(file_path, name, schema, type_name)
|
||||||
|
elif type_name == 'integer':
|
||||||
|
generateIntegerType(file_path, name, schema, type_name)
|
||||||
|
elif type_name == 'number':
|
||||||
|
generateIntegerType(file_path, name, schema, type_name)
|
||||||
|
elif type_name == 'string':
|
||||||
|
generateStringType(file_path, name, schema, type_name)
|
||||||
|
else:
|
||||||
|
print(" unsupported type: ", type_name)
|
||||||
|
raise Exception(" unsupported type: ", type_name)
|
||||||
|
elif '$ref' in schema:
|
||||||
|
# Skip it since we will already have generated it.
|
||||||
|
return
|
||||||
|
elif 'oneOf' in schema:
|
||||||
|
generateOneOfType(file_path, name, schema)
|
||||||
|
else:
|
||||||
|
print(" schema: ", [schema])
|
||||||
|
print(" unsupported type: ", name)
|
||||||
|
raise Exception(" unsupported type: ", name)
|
||||||
|
|
||||||
|
|
||||||
|
def generateOneOfType(path: str, name: str, schema: dict):
|
||||||
|
for t in schema['oneOf']:
|
||||||
|
# Get the name for the reference.
|
||||||
|
if '$ref' in t:
|
||||||
|
name = t['$ref'].replace('#/components/schemas/', '')
|
||||||
|
generateType(path, name, t)
|
||||||
|
else:
|
||||||
|
print(" schema: ", [t])
|
||||||
|
print(" oneOf must be a ref: ", name)
|
||||||
|
raise Exception(" oneOf must be a ref ", name)
|
||||||
|
|
||||||
|
|
||||||
|
def generateStringType(path: str, name: str, schema: dict, type_name: str):
|
||||||
|
print("generating type: ", name, " at: ", path)
|
||||||
|
print(" schema: ", [schema])
|
||||||
|
f = open(path, "w")
|
||||||
|
|
||||||
|
f.write("class " + name + "(str):\n")
|
||||||
|
f.write("\n")
|
||||||
|
f.write("\tdef __str__(self) -> str:\n")
|
||||||
|
f.write("\t\treturn self\n")
|
||||||
|
|
||||||
|
# Close the file.
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
def generateIntegerType(path: str, name: str, schema: dict, type_name: str):
|
||||||
|
print("generating type: ", name, " at: ", path)
|
||||||
|
print(" schema: ", [schema])
|
||||||
|
f = open(path, "w")
|
||||||
|
|
||||||
|
f.write("class " + name + "(int):\n")
|
||||||
|
f.write("\n")
|
||||||
|
f.write("\tdef __int__(self) -> int:\n")
|
||||||
|
f.write("\t\treturn self\n")
|
||||||
|
|
||||||
|
# Close the file.
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
def generateFloatType(path: str, name: str, schema: dict, type_name: str):
|
||||||
|
print("generating type: ", name, " at: ", path)
|
||||||
|
print(" schema: ", [schema])
|
||||||
|
f = open(path, "w")
|
||||||
|
|
||||||
|
f.write("class " + name + "(float):\n")
|
||||||
|
f.write("\n")
|
||||||
|
f.write("\tdef __float__(self) -> float:\n")
|
||||||
|
f.write("\t\treturn self\n")
|
||||||
|
|
||||||
|
# Close the file.
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
def generateEnumType(path: str, name: str, schema: dict, type_name: str):
|
||||||
|
print("generating type: ", name, " at: ", path)
|
||||||
|
print(" schema: ", [schema])
|
||||||
|
f = open(path, "w")
|
||||||
|
|
||||||
|
f.write("from enum import Enum\n")
|
||||||
|
f.write("\n")
|
||||||
|
f.write("class " + name + "(str, Enum):\n")
|
||||||
|
# Iterate over the properties.
|
||||||
|
for value in schema['enum']:
|
||||||
|
f.write(
|
||||||
|
"\t" +
|
||||||
|
camel_to_screaming_snake(value) +
|
||||||
|
" = '" +
|
||||||
|
value +
|
||||||
|
"'\n")
|
||||||
|
|
||||||
|
# close the enum.
|
||||||
|
f.write("\n")
|
||||||
|
f.write("\tdef __str__(self) -> str:\n")
|
||||||
|
f.write("\t\treturn str(self.value)\n")
|
||||||
|
|
||||||
|
# Close the file.
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
def generateObjectType(path: str, name: str, schema: dict, type_name: str):
|
||||||
|
print("generating type: ", name, " at: ", path)
|
||||||
|
print(" schema: ", [schema])
|
||||||
|
f = open(path, "w")
|
||||||
|
|
||||||
has_date_time = hasDateTime(schema)
|
has_date_time = hasDateTime(schema)
|
||||||
if has_date_time:
|
if has_date_time:
|
||||||
f.write("import datetime\n")
|
f.write("import datetime\n")
|
||||||
@ -744,7 +820,9 @@ def generateType(path: str, name: str, schema: dict):
|
|||||||
property_type = property_type.replace(
|
property_type = property_type.replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
f.write(
|
f.write(
|
||||||
"\tfrom ..models import " +
|
"\tfrom ..models." +
|
||||||
|
camel_to_snake(property_type) +
|
||||||
|
" import " +
|
||||||
property_type +
|
property_type +
|
||||||
"\n")
|
"\n")
|
||||||
elif 'type' in property_schema['items']:
|
elif 'type' in property_schema['items']:
|
||||||
@ -860,7 +938,9 @@ def generateType(path: str, name: str, schema: dict):
|
|||||||
property_type = property_type.replace(
|
property_type = property_type.replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
f.write(
|
f.write(
|
||||||
"\t\tfrom ..models import " +
|
"\t\tfrom ..models." +
|
||||||
|
camel_to_snake(property_type) +
|
||||||
|
" import " +
|
||||||
property_type +
|
property_type +
|
||||||
"\n")
|
"\n")
|
||||||
elif 'type' in property_schema['items']:
|
elif 'type' in property_schema['items']:
|
||||||
@ -1027,7 +1107,9 @@ def generateType(path: str, name: str, schema: dict):
|
|||||||
property_type = property_type.replace(
|
property_type = property_type.replace(
|
||||||
'#/components/schemas/', '')
|
'#/components/schemas/', '')
|
||||||
f.write(
|
f.write(
|
||||||
"\t\tfrom ..models import " +
|
"\t\tfrom ..models." +
|
||||||
|
camel_to_snake(property_type) +
|
||||||
|
" import " +
|
||||||
property_type +
|
property_type +
|
||||||
"\n")
|
"\n")
|
||||||
elif 'type' in property_schema['items']:
|
elif 'type' in property_schema['items']:
|
||||||
@ -1135,36 +1217,6 @@ def generateType(path: str, name: str, schema: dict):
|
|||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.write("\tdef __contains__(self, key: str) -> bool:\n")
|
f.write("\tdef __contains__(self, key: str) -> bool:\n")
|
||||||
f.write("\t\treturn key in self.additional_properties\n")
|
f.write("\t\treturn key in self.additional_properties\n")
|
||||||
elif type_name == 'string' and 'enum' in schema:
|
|
||||||
f.write("from enum import Enum\n")
|
|
||||||
f.write("\n")
|
|
||||||
f.write("class " + name + "(str, Enum):\n")
|
|
||||||
# Iterate over the properties.
|
|
||||||
for value in schema['enum']:
|
|
||||||
f.write(
|
|
||||||
"\t" +
|
|
||||||
camel_to_screaming_snake(value) +
|
|
||||||
" = '" +
|
|
||||||
value +
|
|
||||||
"'\n")
|
|
||||||
|
|
||||||
# close the enum.
|
|
||||||
f.write("\n")
|
|
||||||
f.write("\tdef __str__(self) -> str:\n")
|
|
||||||
f.write("\t\treturn str(self.value)\n")
|
|
||||||
elif type_name == 'integer':
|
|
||||||
f.write("class " + name + "(int):\n")
|
|
||||||
f.write("\n")
|
|
||||||
f.write("\tdef __int__(self) -> int:\n")
|
|
||||||
f.write("\t\treturn self\n")
|
|
||||||
elif type_name == 'string':
|
|
||||||
f.write("class " + name + "(str):\n")
|
|
||||||
f.write("\n")
|
|
||||||
f.write("\tdef __str__(self) -> str:\n")
|
|
||||||
f.write("\t\treturn self\n")
|
|
||||||
else:
|
|
||||||
print(" unsupported type: ", type_name)
|
|
||||||
raise Exception(" unsupported type: ", type_name)
|
|
||||||
|
|
||||||
# Close the file.
|
# Close the file.
|
||||||
f.close()
|
f.close()
|
||||||
@ -1176,6 +1228,7 @@ def hasDateTime(schema: dict) -> bool:
|
|||||||
type_name = schema['type']
|
type_name = schema['type']
|
||||||
if type_name == 'object':
|
if type_name == 'object':
|
||||||
# Iternate over the properties.
|
# Iternate over the properties.
|
||||||
|
if 'properties' in schema:
|
||||||
for property_name in schema['properties']:
|
for property_name in schema['properties']:
|
||||||
property_schema = schema['properties'][property_name]
|
property_schema = schema['properties'][property_name]
|
||||||
has_date_time = hasDateTime(property_schema)
|
has_date_time = hasDateTime(property_schema)
|
||||||
@ -1237,7 +1290,18 @@ def getEndpointRefs(endpoint: dict, data: dict) -> [str]:
|
|||||||
if content_type == 'application/json':
|
if content_type == 'application/json':
|
||||||
json = content[content_type]['schema']
|
json = content[content_type]['schema']
|
||||||
if '$ref' in json:
|
if '$ref' in json:
|
||||||
ref = json['$ref'].replace('#/components/schemas/', '')
|
# If the reference is to a oneOf type, we want to return
|
||||||
|
# all the possible outcomes.
|
||||||
|
ref = json['$ref'].replace(
|
||||||
|
'#/components/schemas/', '')
|
||||||
|
schema = data['components']['schemas'][ref]
|
||||||
|
if 'oneOf' in schema:
|
||||||
|
for t in schema['oneOf']:
|
||||||
|
ref = t['$ref'].replace(
|
||||||
|
'#/components/schemas/', '')
|
||||||
|
if ref not in refs:
|
||||||
|
refs.append(ref)
|
||||||
|
else:
|
||||||
if ref not in refs:
|
if ref not in refs:
|
||||||
refs.append(ref)
|
refs.append(ref)
|
||||||
elif 'type' in json:
|
elif 'type' in json:
|
||||||
@ -1349,6 +1413,29 @@ def camel_to_screaming_snake(name: str):
|
|||||||
'_')
|
'_')
|
||||||
|
|
||||||
|
|
||||||
|
def get_function_parameters(endpoint: dict, request_body_type: bool) -> [str]:
|
||||||
|
params = []
|
||||||
|
if 'parameters' in endpoint:
|
||||||
|
parameters = endpoint['parameters']
|
||||||
|
for parameter in parameters:
|
||||||
|
parameter_name = parameter['name']
|
||||||
|
if 'type' in parameter['schema']:
|
||||||
|
parameter_type = parameter['schema']['type'].replace(
|
||||||
|
'string', 'str').replace(
|
||||||
|
'integer', 'int').replace(
|
||||||
|
'number', 'float')
|
||||||
|
elif '$ref' in parameter['schema']:
|
||||||
|
parameter_type = parameter['schema']['$ref'].replace(
|
||||||
|
'#/components/schemas/', '')
|
||||||
|
else:
|
||||||
|
print(" parameter: ", parameter)
|
||||||
|
raise Exception("Unknown parameter type")
|
||||||
|
params.append(camel_to_snake(parameter_name))
|
||||||
|
if request_body_type:
|
||||||
|
params.append("body")
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
if (__name__ == '__main__'):
|
if (__name__ == '__main__'):
|
||||||
exit_code = main()
|
exit_code = main()
|
||||||
exit(exit_code)
|
exit(exit_code)
|
||||||
|
20
generate/run.sh
Executable file
20
generate/run.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# Cleanup old stuff.
|
||||||
|
rm -rf kittycad/models
|
||||||
|
rm -rf kittycad/api
|
||||||
|
git checkout kittycad/api/file/create_file_conversion_with_base64_helper.py
|
||||||
|
git checkout kittycad/api/file/get_file_conversion_with_base64_helper.py
|
||||||
|
|
||||||
|
# Generate new.
|
||||||
|
poetry run python generate/generate.py
|
||||||
|
poetry run autopep8 --in-place --aggressive --aggressive kittycad/models/*.py
|
||||||
|
poetry run autopep8 --in-place --aggressive --aggressive kittycad/api/*.py
|
||||||
|
poetry run autopep8 --in-place --aggressive --aggressive kittycad/*.py
|
||||||
|
poetry run autopep8 --in-place --aggressive --aggressive generate/*.py
|
||||||
|
|
||||||
|
# Lint
|
||||||
|
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
|
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
137
kittycad/api/api-calls/get_async_operation.py
Normal file
137
kittycad/api/api-calls/get_async_operation.py
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.file_conversion import FileConversion
|
||||||
|
from ...models.file_mass import FileMass
|
||||||
|
from ...models.file_volume import FileVolume
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/async/operations/{id}".format(client.base_url, id=id)
|
||||||
|
|
||||||
|
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[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
data = response.json()
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileConversion.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileMass.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileVolume.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, 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[Union[Any, FileConversion, FileMass, FileVolume, 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[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
|
""" Get the status and output of an async operation.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
|
||||||
|
If the user is not authenticated to view the specified async operation, then it is not returned.
|
||||||
|
Only KittyCAD employees with the proper access can view async operations for other users. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, 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[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
|
""" Get the status and output of an async operation.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
|
||||||
|
If the user is not authenticated to view the specified async operation, then it is not returned.
|
||||||
|
Only KittyCAD employees with the proper access can view async operations for other users. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
1
kittycad/api/beta/__init__.py
Normal file
1
kittycad/api/beta/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
""" Contains methods for accessing the beta API paths: Beta API endpoints. We will not charge for these endpoints while they are in beta. """
|
@ -3,15 +3,15 @@ from typing import Any, Dict, Optional, Union, cast
|
|||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import Client
|
from ...client import Client
|
||||||
from ...models.file_conversion_with_output import FileConversionWithOutput
|
from ...models.file_conversion import FileConversion
|
||||||
from ...models.error import Error
|
from ...models.error import Error
|
||||||
from ...models.file_conversion_output_format import FileConversionOutputFormat
|
from ...models.file_output_format import FileOutputFormat
|
||||||
from ...models.file_conversion_source_format import FileConversionSourceFormat
|
from ...models.file_source_format import FileSourceFormat
|
||||||
from ...types import Response
|
from ...types import Response
|
||||||
|
|
||||||
def _get_kwargs(
|
def _get_kwargs(
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
@ -30,9 +30,9 @@ def _get_kwargs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
if response.status_code == 201:
|
if response.status_code == 201:
|
||||||
response_201 = FileConversionWithOutput.from_dict(response.json())
|
response_201 = FileConversion.from_dict(response.json())
|
||||||
return response_201
|
return response_201
|
||||||
if response.status_code == 400:
|
if response.status_code == 400:
|
||||||
response_4XX = Error.from_dict(response.json())
|
response_4XX = Error.from_dict(response.json())
|
||||||
@ -43,7 +43,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, Error]]:
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=response.status_code,
|
||||||
content=response.content,
|
content=response.content,
|
||||||
@ -53,12 +53,12 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConv
|
|||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
def sync_detailed(
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Response[Union[Any, FileConversion, Error]]:
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
output_format=output_format,
|
output_format=output_format,
|
||||||
src_format=src_format,
|
src_format=src_format,
|
||||||
@ -75,15 +75,15 @@ def sync_detailed(
|
|||||||
|
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
""" Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.
|
""" Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.
|
||||||
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
||||||
If the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint. """
|
If the 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. """
|
||||||
|
|
||||||
return sync_detailed(
|
return sync_detailed(
|
||||||
output_format=output_format,
|
output_format=output_format,
|
||||||
@ -94,12 +94,12 @@ If the conversion is performed asynchronously, the `id` of the conversion will b
|
|||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
async def asyncio_detailed(
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Response[Union[Any, FileConversion, Error]]:
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
output_format=output_format,
|
output_format=output_format,
|
||||||
src_format=src_format,
|
src_format=src_format,
|
||||||
@ -114,15 +114,15 @@ async def asyncio_detailed(
|
|||||||
|
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
""" Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.
|
""" Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.
|
||||||
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
||||||
If the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint. """
|
If the 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. """
|
||||||
|
|
||||||
return (
|
return (
|
||||||
await asyncio_detailed(
|
await asyncio_detailed(
|
||||||
|
@ -5,19 +5,19 @@ import httpx
|
|||||||
|
|
||||||
from ...client import Client
|
from ...client import Client
|
||||||
from ...models import Error
|
from ...models import Error
|
||||||
from ...models import FileConversionWithOutput
|
from ...models import FileConversion
|
||||||
from ...models import FileConversionSourceFormat
|
from ...models import FileSourceFormat
|
||||||
from ...models import FileConversionOutputFormat
|
from ...models import FileOutputFormat
|
||||||
from ...types import Response
|
from ...types import Response
|
||||||
from ...api.file.create_file_conversion import sync as fc_sync, asyncio as fc_asyncio
|
from ...api.file.create_file_conversion import sync as fc_sync, asyncio as fc_asyncio
|
||||||
|
|
||||||
def sync(
|
def sync(
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
|
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
|
||||||
|
|
||||||
encoded = base64.b64encode(body)
|
encoded = base64.b64encode(body)
|
||||||
@ -29,19 +29,19 @@ def sync(
|
|||||||
client=client,
|
client=client,
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(fc, FileConversionWithOutput) and fc.output != "":
|
if isinstance(fc, FileConversion) and fc.output != "":
|
||||||
fc.output = base64.b64decode(fc.output)
|
fc.output = base64.b64decode(fc.output)
|
||||||
|
|
||||||
return fc
|
return fc
|
||||||
|
|
||||||
|
|
||||||
async def asyncio(
|
async def asyncio(
|
||||||
src_format: FileConversionSourceFormat,
|
src_format: FileSourceFormat,
|
||||||
output_format: FileConversionOutputFormat,
|
output_format: FileOutputFormat,
|
||||||
body: bytes,
|
body: bytes,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
|
"""Convert a CAD file from one format to another. If the file being converted is larger than a certain size it will be performed asynchronously. This function automatically base64 encodes the request body and base64 decodes the request output."""
|
||||||
|
|
||||||
encoded = base64.b64encode(body)
|
encoded = base64.b64encode(body)
|
||||||
@ -53,7 +53,7 @@ async def asyncio(
|
|||||||
client=client,
|
client=client,
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(fc, FileConversionWithOutput) and fc.output != "":
|
if isinstance(fc, FileConversion) and fc.output != "":
|
||||||
fc.output = base64.b64decode(fc.output)
|
fc.output = base64.b64decode(fc.output)
|
||||||
|
|
||||||
return fc
|
return fc
|
||||||
|
127
kittycad/api/file/create_file_execution.py
Normal file
127
kittycad/api/file/create_file_execution.py
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.code_output import CodeOutput
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.code_language import CodeLanguage
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
lang: CodeLanguage,
|
||||||
|
output: str,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/file/execute/{lang}".format(client.base_url, lang=lang, output=output)
|
||||||
|
|
||||||
|
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[Union[Any, CodeOutput, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = CodeOutput.from_dict(response.json())
|
||||||
|
return response_200
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, CodeOutput, Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
lang: CodeLanguage,
|
||||||
|
output: str,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, CodeOutput, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
lang=lang,
|
||||||
|
output=output,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.post(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
lang: CodeLanguage,
|
||||||
|
output: str,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, CodeOutput, Error]]:
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
lang=lang,
|
||||||
|
output=output,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
lang: CodeLanguage,
|
||||||
|
output: str,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, CodeOutput, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
lang=lang,
|
||||||
|
output=output,
|
||||||
|
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(
|
||||||
|
lang: CodeLanguage,
|
||||||
|
output: str,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, CodeOutput, Error]]:
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
lang=lang,
|
||||||
|
output=output,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
131
kittycad/api/file/create_file_mass.py
Normal file
131
kittycad/api/file/create_file_mass.py
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.file_mass import FileMass
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.file_source_format import FileSourceFormat
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
material_density: float,
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/file/mass".format(client.base_url, material_density=material_density, src_format=src_format)
|
||||||
|
|
||||||
|
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[Union[Any, FileMass, Error]]:
|
||||||
|
if response.status_code == 201:
|
||||||
|
response_201 = FileMass.from_dict(response.json())
|
||||||
|
return response_201
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileMass, Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
material_density: float,
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, FileMass, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
material_density=material_density,
|
||||||
|
src_format=src_format,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.post(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
material_density: float,
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, FileMass, Error]]:
|
||||||
|
""" Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.
|
||||||
|
If the 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. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
material_density=material_density,
|
||||||
|
src_format=src_format,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
material_density: float,
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, FileMass, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
material_density=material_density,
|
||||||
|
src_format=src_format,
|
||||||
|
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(
|
||||||
|
material_density: float,
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, FileMass, Error]]:
|
||||||
|
""" Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.
|
||||||
|
If the 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. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
material_density=material_density,
|
||||||
|
src_format=src_format,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
122
kittycad/api/file/create_file_volume.py
Normal file
122
kittycad/api/file/create_file_volume.py
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.file_volume import FileVolume
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.file_source_format import FileSourceFormat
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/file/volume".format(client.base_url, src_format=src_format)
|
||||||
|
|
||||||
|
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[Union[Any, FileVolume, Error]]:
|
||||||
|
if response.status_code == 201:
|
||||||
|
response_201 = FileVolume.from_dict(response.json())
|
||||||
|
return response_201
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileVolume, Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, FileVolume, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
src_format=src_format,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.post(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, FileVolume, Error]]:
|
||||||
|
""" Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.
|
||||||
|
If the 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. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
src_format=src_format,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, FileVolume, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
src_format=src_format,
|
||||||
|
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(
|
||||||
|
src_format: FileSourceFormat,
|
||||||
|
body: bytes,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, FileVolume, Error]]:
|
||||||
|
""" Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.
|
||||||
|
If the 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. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
src_format=src_format,
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
@ -3,7 +3,9 @@ from typing import Any, Dict, Optional, Union, cast
|
|||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import Client
|
from ...client import Client
|
||||||
from ...models.file_conversion_with_output import FileConversionWithOutput
|
from ...models.file_conversion import FileConversion
|
||||||
|
from ...models.file_mass import FileMass
|
||||||
|
from ...models.file_volume import FileVolume
|
||||||
from ...models.error import Error
|
from ...models.error import Error
|
||||||
from ...types import Response
|
from ...types import Response
|
||||||
|
|
||||||
@ -25,10 +27,30 @@ def _get_kwargs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
response_200 = FileConversionWithOutput.from_dict(response.json())
|
data = response.json()
|
||||||
return response_200
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileConversion.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileMass.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileVolume.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
raise
|
||||||
if response.status_code == 400:
|
if response.status_code == 400:
|
||||||
response_4XX = Error.from_dict(response.json())
|
response_4XX = Error.from_dict(response.json())
|
||||||
return response_4XX
|
return response_4XX
|
||||||
@ -38,7 +60,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=response.status_code,
|
||||||
content=response.content,
|
content=response.content,
|
||||||
@ -51,7 +73,7 @@ def sync_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
id=id,
|
id=id,
|
||||||
client=client,
|
client=client,
|
||||||
@ -69,7 +91,7 @@ def sync(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
""" Get the status and output of an async file conversion.
|
""" Get the status and output of an async file conversion.
|
||||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
|
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
|
||||||
If the user is not authenticated to view the specified file conversion, then it is not returned.
|
If the user is not authenticated to view the specified file conversion, then it is not returned.
|
||||||
@ -85,7 +107,7 @@ async def asyncio_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
id=id,
|
id=id,
|
||||||
client=client,
|
client=client,
|
||||||
@ -101,7 +123,7 @@ async def asyncio(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
""" Get the status and output of an async file conversion.
|
""" Get the status and output of an async file conversion.
|
||||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
|
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
|
||||||
If the user is not authenticated to view the specified file conversion, then it is not returned.
|
If the user is not authenticated to view the specified file conversion, then it is not returned.
|
||||||
|
@ -3,7 +3,9 @@ from typing import Any, Dict, Optional, Union, cast
|
|||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from ...client import Client
|
from ...client import Client
|
||||||
from ...models.file_conversion_with_output import FileConversionWithOutput
|
from ...models.file_conversion import FileConversion
|
||||||
|
from ...models.file_mass import FileMass
|
||||||
|
from ...models.file_volume import FileVolume
|
||||||
from ...models.error import Error
|
from ...models.error import Error
|
||||||
from ...types import Response
|
from ...types import Response
|
||||||
|
|
||||||
@ -25,10 +27,30 @@ def _get_kwargs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
response_200 = FileConversionWithOutput.from_dict(response.json())
|
data = response.json()
|
||||||
return response_200
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileConversion.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileMass.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not isinstance(data, dict):
|
||||||
|
raise TypeError()
|
||||||
|
option = FileVolume.from_dict(data)
|
||||||
|
return option
|
||||||
|
except:
|
||||||
|
raise
|
||||||
if response.status_code == 400:
|
if response.status_code == 400:
|
||||||
response_4XX = Error.from_dict(response.json())
|
response_4XX = Error.from_dict(response.json())
|
||||||
return response_4XX
|
return response_4XX
|
||||||
@ -38,7 +60,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
return Response(
|
return Response(
|
||||||
status_code=response.status_code,
|
status_code=response.status_code,
|
||||||
content=response.content,
|
content=response.content,
|
||||||
@ -51,7 +73,7 @@ def sync_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
id=id,
|
id=id,
|
||||||
client=client,
|
client=client,
|
||||||
@ -69,7 +91,7 @@ def sync(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
||||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
|
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
|
||||||
|
|
||||||
@ -83,7 +105,7 @@ async def asyncio_detailed(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Response[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
kwargs = _get_kwargs(
|
kwargs = _get_kwargs(
|
||||||
id=id,
|
id=id,
|
||||||
client=client,
|
client=client,
|
||||||
@ -99,7 +121,7 @@ async def asyncio(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, FileMass, FileVolume, Error]]:
|
||||||
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
|
||||||
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
|
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import httpx
|
|||||||
|
|
||||||
from ...client import Client
|
from ...client import Client
|
||||||
from ...models import Error
|
from ...models import Error
|
||||||
from ...models.file_conversion import FileConversionWithOutput
|
from ...models.file_conversion import FileConversion
|
||||||
from ...types import Response
|
from ...types import Response
|
||||||
from ...api.file.get_file_conversion import sync as fc_sync, asyncio as fc_asyncio
|
from ...api.file.get_file_conversion import sync as fc_sync, asyncio as fc_asyncio
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ def sync(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
|
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
|
||||||
|
|
||||||
fc = fc_sync(
|
fc = fc_sync(
|
||||||
@ -22,7 +22,7 @@ def sync(
|
|||||||
client=client,
|
client=client,
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(fc, FileConversionWithOutput) and fc.output != "":
|
if isinstance(fc, FileConversion) and fc.output != "":
|
||||||
fc.output = base64.b64decode(fc.output)
|
fc.output = base64.b64decode(fc.output)
|
||||||
|
|
||||||
return fc
|
return fc
|
||||||
@ -32,7 +32,7 @@ async def asyncio(
|
|||||||
id: str,
|
id: str,
|
||||||
*,
|
*,
|
||||||
client: Client,
|
client: Client,
|
||||||
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
|
) -> Optional[Union[Any, FileConversion, Error]]:
|
||||||
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
|
"""Get the status of a file conversion. This function automatically base64 decodes the output response if there is one."""
|
||||||
|
|
||||||
fc = await fc_asyncio(
|
fc = await fc_asyncio(
|
||||||
@ -40,7 +40,7 @@ async def asyncio(
|
|||||||
client=client,
|
client=client,
|
||||||
)
|
)
|
||||||
|
|
||||||
if isinstance(fc, FileConversionWithOutput) and fc.output != "":
|
if isinstance(fc, FileConversion) and fc.output != "":
|
||||||
fc.output = base64.b64decode(fc.output)
|
fc.output = base64.b64decode(fc.output)
|
||||||
|
|
||||||
return fc
|
return fc
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
from typing import Any, Dict, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import Client
|
|
||||||
from ...models.file_conversion_results_page import FileConversionResultsPage
|
|
||||||
from ...models.error import Error
|
|
||||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
|
||||||
from ...models.file_conversion_status import FileConversionStatus
|
|
||||||
from ...types import Response
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
status: FileConversionStatus,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/file/conversions".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by, status=status)
|
|
||||||
|
|
||||||
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[Any, FileConversionResultsPage, Error]]:
|
|
||||||
if response.status_code == 200:
|
|
||||||
response_200 = FileConversionResultsPage.from_dict(response.json())
|
|
||||||
return response_200
|
|
||||||
if response.status_code == 400:
|
|
||||||
response_4XX = Error.from_dict(response.json())
|
|
||||||
return response_4XX
|
|
||||||
if response.status_code == 500:
|
|
||||||
response_5XX = Error.from_dict(response.json())
|
|
||||||
return response_5XX
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
status: FileConversionStatus,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Response[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
limit=limit,
|
|
||||||
page_token=page_token,
|
|
||||||
sort_by=sort_by,
|
|
||||||
status=status,
|
|
||||||
client=client,
|
|
||||||
)
|
|
||||||
|
|
||||||
response = httpx.get(
|
|
||||||
verify=client.verify_ssl,
|
|
||||||
**kwargs,
|
|
||||||
)
|
|
||||||
|
|
||||||
return _build_response(response=response)
|
|
||||||
|
|
||||||
|
|
||||||
def sync(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
status: FileConversionStatus,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
|
|
||||||
This endpoint requires authentication by a KittyCAD employee. """
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
limit=limit,
|
|
||||||
page_token=page_token,
|
|
||||||
sort_by=sort_by,
|
|
||||||
status=status,
|
|
||||||
client=client,
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
status: FileConversionStatus,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Response[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
kwargs = _get_kwargs(
|
|
||||||
limit=limit,
|
|
||||||
page_token=page_token,
|
|
||||||
sort_by=sort_by,
|
|
||||||
status=status,
|
|
||||||
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(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
status: FileConversionStatus,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
|
|
||||||
This endpoint requires authentication by a KittyCAD employee. """
|
|
||||||
|
|
||||||
return (
|
|
||||||
await asyncio_detailed(
|
|
||||||
limit=limit,
|
|
||||||
page_token=page_token,
|
|
||||||
sort_by=sort_by,
|
|
||||||
status=status,
|
|
||||||
client=client,
|
|
||||||
)
|
|
||||||
).parsed
|
|
@ -1,132 +0,0 @@
|
|||||||
from typing import Any, Dict, Optional, Union, cast
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from ...client import Client
|
|
||||||
from ...models.file_conversion_results_page import FileConversionResultsPage
|
|
||||||
from ...models.error import Error
|
|
||||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
|
||||||
from ...types import Response
|
|
||||||
|
|
||||||
def _get_kwargs(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Dict[str, Any]:
|
|
||||||
url = "{}/user/file/conversions".format(client.base_url, limit=limit, page_token=page_token, sort_by=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[Any, FileConversionResultsPage, Error]]:
|
|
||||||
if response.status_code == 200:
|
|
||||||
response_200 = FileConversionResultsPage.from_dict(response.json())
|
|
||||||
return response_200
|
|
||||||
if response.status_code == 400:
|
|
||||||
response_4XX = Error.from_dict(response.json())
|
|
||||||
return response_4XX
|
|
||||||
if response.status_code == 500:
|
|
||||||
response_5XX = Error.from_dict(response.json())
|
|
||||||
return response_5XX
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
return Response(
|
|
||||||
status_code=response.status_code,
|
|
||||||
content=response.content,
|
|
||||||
headers=response.headers,
|
|
||||||
parsed=_parse_response(response=response),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def sync_detailed(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Response[Union[Any, FileConversionResultsPage, 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(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
|
|
||||||
This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.
|
|
||||||
The file conversions are returned in order of creation, with the most recently created file conversions first. """
|
|
||||||
|
|
||||||
return sync_detailed(
|
|
||||||
limit=limit,
|
|
||||||
page_token=page_token,
|
|
||||||
sort_by=sort_by,
|
|
||||||
client=client,
|
|
||||||
).parsed
|
|
||||||
|
|
||||||
|
|
||||||
async def asyncio_detailed(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Response[Union[Any, FileConversionResultsPage, 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(
|
|
||||||
limit: int,
|
|
||||||
page_token: str,
|
|
||||||
sort_by: CreatedAtSortMode,
|
|
||||||
*,
|
|
||||||
client: Client,
|
|
||||||
) -> Optional[Union[Any, FileConversionResultsPage, Error]]:
|
|
||||||
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
|
|
||||||
This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.
|
|
||||||
The file conversions are returned in order of creation, with the most recently created file conversions first. """
|
|
||||||
|
|
||||||
return (
|
|
||||||
await asyncio_detailed(
|
|
||||||
limit=limit,
|
|
||||||
page_token=page_token,
|
|
||||||
sort_by=sort_by,
|
|
||||||
client=client,
|
|
||||||
)
|
|
||||||
).parsed
|
|
1
kittycad/api/hidden/__init__.py
Normal file
1
kittycad/api/hidden/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
""" Contains methods for accessing the hidden API paths: Hidden API endpoints that should not show up in the docs. """
|
108
kittycad/api/hidden/login.py
Normal file
108
kittycad/api/hidden/login.py
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.login_params import LoginParams
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
body: LoginParams,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/login".format(client.base_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(),
|
||||||
|
"content": body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Error]]:
|
||||||
|
if response.status_code == 204:
|
||||||
|
response_204 = None
|
||||||
|
return response_204
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
body: LoginParams,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.post(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
body: LoginParams,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, Error]]:
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
body: LoginParams,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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: LoginParams,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, Error]]:
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
1
kittycad/api/payments/__init__.py
Normal file
1
kittycad/api/payments/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
""" Contains methods for accessing the payments API paths: Operations around payments and billing. """
|
113
kittycad/api/payments/create_payment_information_for_user.py
Normal file
113
kittycad/api/payments/create_payment_information_for_user.py
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.customer import Customer
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.billing_info import BillingInfo
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
body: BillingInfo,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/payment".format(client.base_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(),
|
||||||
|
"content": body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Customer, Error]]:
|
||||||
|
if response.status_code == 201:
|
||||||
|
response_201 = Customer.from_dict(response.json())
|
||||||
|
return response_201
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, 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[Union[Any, 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[Any, Customer, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
body: BillingInfo,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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[Any, Customer, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
100
kittycad/api/payments/create_payment_intent_for_user.py
Normal file
100
kittycad/api/payments/create_payment_intent_for_user.py
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.payment_intent import PaymentIntent
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/payment/intent".format(client.base_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[Union[Any, PaymentIntent, Error]]:
|
||||||
|
if response.status_code == 201:
|
||||||
|
response_201 = PaymentIntent.from_dict(response.json())
|
||||||
|
return response_201
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, 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[Union[Any, 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[Any, PaymentIntent, Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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[Any, PaymentIntent, Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
101
kittycad/api/payments/delete_payment_information_for_user.py
Normal file
101
kittycad/api/payments/delete_payment_information_for_user.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/payment".format(client.base_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[Union[Any, Error]]:
|
||||||
|
if response.status_code == 204:
|
||||||
|
response_204 = None
|
||||||
|
return response_204
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, 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[Union[Any, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.delete(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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[Union[Any, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
108
kittycad/api/payments/delete_payment_method_for_user.py
Normal file
108
kittycad/api/payments/delete_payment_method_for_user.py
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
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 = "{}/user/payment/methods/{id}".format(client.base_url, id=id)
|
||||||
|
|
||||||
|
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[Any, Error]]:
|
||||||
|
if response.status_code == 204:
|
||||||
|
response_204 = None
|
||||||
|
return response_204
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, 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[Union[Any, 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[Union[Any, Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
id=id,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
id: str,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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[Union[Any, Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
id=id,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
102
kittycad/api/payments/get_payment_information_for_user.py
Normal file
102
kittycad/api/payments/get_payment_information_for_user.py
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
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 = "{}/user/payment".format(client.base_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[Union[Any, Customer, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = Customer.from_dict(response.json())
|
||||||
|
return response_200
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, 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[Union[Any, 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[Any, Customer, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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[Any, Customer, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
103
kittycad/api/payments/list_invoices_for_user.py
Normal file
103
kittycad/api/payments/list_invoices_for_user.py
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.invoice import Invoice
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/payment/invoices".format(client.base_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[Union[Any, [Invoice], Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = [
|
||||||
|
Invoice.from_dict(item)
|
||||||
|
for item in response.json()
|
||||||
|
]
|
||||||
|
return response_200
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [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[Union[Any, [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[Any, [Invoice], Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, [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[Any, [Invoice], Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
103
kittycad/api/payments/list_payment_methods_for_user.py
Normal file
103
kittycad/api/payments/list_payment_methods_for_user.py
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.payment_method import PaymentMethod
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/payment/methods".format(client.base_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[Union[Any, [PaymentMethod], Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = [
|
||||||
|
PaymentMethod.from_dict(item)
|
||||||
|
for item in response.json()
|
||||||
|
]
|
||||||
|
return response_200
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [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[Union[Any, [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[Any, [PaymentMethod], Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, [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[Any, [PaymentMethod], Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
113
kittycad/api/payments/update_payment_information_for_user.py
Normal file
113
kittycad/api/payments/update_payment_information_for_user.py
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.customer import Customer
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.billing_info import BillingInfo
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
body: BillingInfo,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user/payment".format(client.base_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(),
|
||||||
|
"content": body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, Customer, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = Customer.from_dict(response.json())
|
||||||
|
return response_200
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, 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[Union[Any, 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[Any, Customer, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
body: BillingInfo,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, 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[Any, Customer, Error]]:
|
||||||
|
""" This includes billing address, phone, and name.
|
||||||
|
This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
111
kittycad/api/users/update_user_self.py
Normal file
111
kittycad/api/users/update_user_self.py
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
from typing import Any, Dict, Optional, Union, cast
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
|
||||||
|
from ...client import Client
|
||||||
|
from ...models.user import User
|
||||||
|
from ...models.error import Error
|
||||||
|
from ...models.update_user import UpdateUser
|
||||||
|
from ...types import Response
|
||||||
|
|
||||||
|
def _get_kwargs(
|
||||||
|
body: UpdateUser,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Dict[str, Any]:
|
||||||
|
url = "{}/user".format(client.base_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(),
|
||||||
|
"content": body,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Error]]:
|
||||||
|
if response.status_code == 200:
|
||||||
|
response_200 = User.from_dict(response.json())
|
||||||
|
return response_200
|
||||||
|
if response.status_code == 400:
|
||||||
|
response_4XX = Error.from_dict(response.json())
|
||||||
|
return response_4XX
|
||||||
|
if response.status_code == 500:
|
||||||
|
response_5XX = Error.from_dict(response.json())
|
||||||
|
return response_5XX
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _build_response(*, response: httpx.Response) -> Response[Union[Any, User, Error]]:
|
||||||
|
return Response(
|
||||||
|
status_code=response.status_code,
|
||||||
|
content=response.content,
|
||||||
|
headers=response.headers,
|
||||||
|
parsed=_parse_response(response=response),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def sync_detailed(
|
||||||
|
body: UpdateUser,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, User, Error]]:
|
||||||
|
kwargs = _get_kwargs(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
|
||||||
|
response = httpx.put(
|
||||||
|
verify=client.verify_ssl,
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
return _build_response(response=response)
|
||||||
|
|
||||||
|
|
||||||
|
def sync(
|
||||||
|
body: UpdateUser,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, User, Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user. """
|
||||||
|
|
||||||
|
return sync_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
).parsed
|
||||||
|
|
||||||
|
|
||||||
|
async def asyncio_detailed(
|
||||||
|
body: UpdateUser,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Response[Union[Any, User, 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: UpdateUser,
|
||||||
|
*,
|
||||||
|
client: Client,
|
||||||
|
) -> Optional[Union[Any, User, Error]]:
|
||||||
|
""" This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user. """
|
||||||
|
|
||||||
|
return (
|
||||||
|
await asyncio_detailed(
|
||||||
|
body=body,
|
||||||
|
client=client,
|
||||||
|
)
|
||||||
|
).parsed
|
@ -3,7 +3,7 @@ import pytest
|
|||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from .client import ClientFromEnv
|
from .client import ClientFromEnv
|
||||||
from .models import FileConversion, FileConversionOutputFormat, FileConversionSourceFormat, User, Pong, FileConversionStatus
|
from .models import FileConversion, FileOutputFormat, FileSourceFormat, User, Pong, APICallStatus
|
||||||
from .api.file import create_file_conversion_with_base64_helper
|
from .api.file import create_file_conversion_with_base64_helper
|
||||||
from .api.meta import ping
|
from .api.meta import ping
|
||||||
from .api.users import get_user_self
|
from .api.users import get_user_self
|
||||||
@ -72,8 +72,8 @@ def test_file_convert_stl():
|
|||||||
fc: FileConversion = create_file_conversion_with_base64_helper.sync(
|
fc: FileConversion = create_file_conversion_with_base64_helper.sync(
|
||||||
client=client,
|
client=client,
|
||||||
body=content,
|
body=content,
|
||||||
src_format=FileConversionSourceFormat.STL,
|
src_format=FileSourceFormat.STL,
|
||||||
output_format=FileConversionOutputFormat.OBJ)
|
output_format=FileOutputFormat.OBJ)
|
||||||
|
|
||||||
assert fc is not None
|
assert fc is not None
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ def test_file_convert_stl():
|
|||||||
|
|
||||||
assert fc.id is not None
|
assert fc.id is not None
|
||||||
|
|
||||||
assert fc.status == FileConversionStatus.COMPLETED
|
assert fc.status == APICallStatus.COMPLETED
|
||||||
|
|
||||||
print(f"FileConversion: {fc}")
|
print(f"FileConversion: {fc}")
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ async def test_file_convert_stl_async():
|
|||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
# Get the fc.
|
# Get the fc.
|
||||||
fc: FileConversion = await create_file_conversion_with_base64_helper.asyncio(client=client, body=content, src_format=FileConversionSourceFormat.STL, output_format=FileConversionOutputFormat.OBJ)
|
fc: FileConversion = await create_file_conversion_with_base64_helper.asyncio(client=client, body=content, src_format=FileSourceFormat.STL, output_format=FileOutputFormat.OBJ)
|
||||||
|
|
||||||
assert fc is not None
|
assert fc is not None
|
||||||
|
|
||||||
|
@ -1,38 +1,56 @@
|
|||||||
""" Contains all the data models used in inputs/outputs """
|
""" Contains all the data models used in inputs/outputs """
|
||||||
|
|
||||||
|
from .api_call_status import APICallStatus
|
||||||
|
from .address import Address
|
||||||
from .api_call_query_group import ApiCallQueryGroup
|
from .api_call_query_group import ApiCallQueryGroup
|
||||||
from .api_call_query_group_by import ApiCallQueryGroupBy
|
from .api_call_query_group_by import ApiCallQueryGroupBy
|
||||||
from .api_call_with_price import ApiCallWithPrice
|
from .api_call_with_price import ApiCallWithPrice
|
||||||
from .api_call_with_price_results_page import ApiCallWithPriceResultsPage
|
from .api_call_with_price_results_page import ApiCallWithPriceResultsPage
|
||||||
from .api_token import ApiToken
|
from .api_token import ApiToken
|
||||||
from .api_token_results_page import ApiTokenResultsPage
|
from .api_token_results_page import ApiTokenResultsPage
|
||||||
|
from .billing_info import BillingInfo
|
||||||
|
from .cache_metadata import CacheMetadata
|
||||||
|
from .card_details import CardDetails
|
||||||
from .cluster import Cluster
|
from .cluster import Cluster
|
||||||
|
from .code_language import CodeLanguage
|
||||||
|
from .code_output import CodeOutput
|
||||||
|
from .connection import Connection
|
||||||
from .created_at_sort_mode import CreatedAtSortMode
|
from .created_at_sort_mode import CreatedAtSortMode
|
||||||
|
from .currency import Currency
|
||||||
|
from .customer import Customer
|
||||||
from .duration import Duration
|
from .duration import Duration
|
||||||
from .engine_metadata import EngineMetadata
|
from .engine_metadata import EngineMetadata
|
||||||
|
from .environment import Environment
|
||||||
from .error import Error
|
from .error import Error
|
||||||
from .extended_user import ExtendedUser
|
from .extended_user import ExtendedUser
|
||||||
from .extended_user_results_page import ExtendedUserResultsPage
|
from .extended_user_results_page import ExtendedUserResultsPage
|
||||||
from .file_conversion import FileConversion
|
from .file_conversion import FileConversion
|
||||||
from .file_conversion_output_format import FileConversionOutputFormat
|
from .file_mass import FileMass
|
||||||
from .file_conversion_results_page import FileConversionResultsPage
|
from .file_output_format import FileOutputFormat
|
||||||
from .file_conversion_source_format import FileConversionSourceFormat
|
from .file_source_format import FileSourceFormat
|
||||||
from .file_conversion_status import FileConversionStatus
|
|
||||||
from .file_conversion_with_output import FileConversionWithOutput
|
|
||||||
from .file_system_metadata import FileSystemMetadata
|
from .file_system_metadata import FileSystemMetadata
|
||||||
|
from .file_volume import FileVolume
|
||||||
from .gateway import Gateway
|
from .gateway import Gateway
|
||||||
|
from .invoice import Invoice
|
||||||
|
from .invoice_line_item import InvoiceLineItem
|
||||||
|
from .invoice_status import InvoiceStatus
|
||||||
from .jetstream import Jetstream
|
from .jetstream import Jetstream
|
||||||
from .jetstream_api_stats import JetstreamApiStats
|
from .jetstream_api_stats import JetstreamApiStats
|
||||||
from .jetstream_config import JetstreamConfig
|
from .jetstream_config import JetstreamConfig
|
||||||
from .jetstream_stats import JetstreamStats
|
from .jetstream_stats import JetstreamStats
|
||||||
from .leaf_node import LeafNode
|
from .leaf_node import LeafNode
|
||||||
|
from .login_params import LoginParams
|
||||||
from .meta_cluster_info import MetaClusterInfo
|
from .meta_cluster_info import MetaClusterInfo
|
||||||
from .metadata import Metadata
|
from .metadata import Metadata
|
||||||
from .method import Method
|
from .method import Method
|
||||||
from .nats_connection import NatsConnection
|
from .payment_intent import PaymentIntent
|
||||||
|
from .payment_method import PaymentMethod
|
||||||
|
from .payment_method_card_checks import PaymentMethodCardChecks
|
||||||
|
from .payment_method_type import PaymentMethodType
|
||||||
from .pong import Pong
|
from .pong import Pong
|
||||||
from .session import Session
|
from .session import Session
|
||||||
from .status_code import StatusCode
|
from .status_code import StatusCode
|
||||||
|
from .update_user import UpdateUser
|
||||||
from .user import User
|
from .user import User
|
||||||
from .user_results_page import UserResultsPage
|
from .user_results_page import UserResultsPage
|
||||||
from .uuid import Uuid
|
from .uuid import Uuid
|
||||||
|
141
kittycad/models/address.py
Normal file
141
kittycad/models/address.py
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
import datetime
|
||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.uuid import Uuid
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="Address")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class Address:
|
||||||
|
""" """
|
||||||
|
city: Union[Unset, str] = UNSET
|
||||||
|
country: Union[Unset, str] = UNSET
|
||||||
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
id: Union[Unset, Uuid] = UNSET
|
||||||
|
state: Union[Unset, str] = UNSET
|
||||||
|
street1: Union[Unset, str] = UNSET
|
||||||
|
street2: Union[Unset, str] = UNSET
|
||||||
|
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
user_id: Union[Unset, str] = UNSET
|
||||||
|
zip: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
city = self.city
|
||||||
|
country = self.country
|
||||||
|
created_at: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.created_at, Unset):
|
||||||
|
created_at = self.created_at.isoformat()
|
||||||
|
id: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.id, Unset):
|
||||||
|
id = self.id.value
|
||||||
|
state = self.state
|
||||||
|
street1 = self.street1
|
||||||
|
street2 = self.street2
|
||||||
|
updated_at: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.updated_at, Unset):
|
||||||
|
updated_at = self.updated_at.isoformat()
|
||||||
|
user_id = self.user_id
|
||||||
|
zip = self.zip
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if city is not UNSET:
|
||||||
|
field_dict['city'] = city
|
||||||
|
if country is not UNSET:
|
||||||
|
field_dict['country'] = country
|
||||||
|
if created_at is not UNSET:
|
||||||
|
field_dict['created_at'] = created_at
|
||||||
|
if id is not UNSET:
|
||||||
|
field_dict['id'] = id
|
||||||
|
if state is not UNSET:
|
||||||
|
field_dict['state'] = state
|
||||||
|
if street1 is not UNSET:
|
||||||
|
field_dict['street1'] = street1
|
||||||
|
if street2 is not UNSET:
|
||||||
|
field_dict['street2'] = street2
|
||||||
|
if updated_at is not UNSET:
|
||||||
|
field_dict['updated_at'] = updated_at
|
||||||
|
if user_id is not UNSET:
|
||||||
|
field_dict['user_id'] = user_id
|
||||||
|
if zip is not UNSET:
|
||||||
|
field_dict['zip'] = zip
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
city = d.pop("city", UNSET)
|
||||||
|
|
||||||
|
country = d.pop("country", UNSET)
|
||||||
|
|
||||||
|
_created_at = d.pop("created_at", UNSET)
|
||||||
|
created_at: Union[Unset, datetime.datetime]
|
||||||
|
if isinstance(_created_at, Unset):
|
||||||
|
created_at = UNSET
|
||||||
|
else:
|
||||||
|
created_at = isoparse(_created_at)
|
||||||
|
|
||||||
|
_id = d.pop("id", UNSET)
|
||||||
|
id: Union[Unset, Uuid]
|
||||||
|
if isinstance(_id, Unset):
|
||||||
|
id = UNSET
|
||||||
|
else:
|
||||||
|
id = Uuid(_id)
|
||||||
|
|
||||||
|
state = d.pop("state", UNSET)
|
||||||
|
|
||||||
|
street1 = d.pop("street1", UNSET)
|
||||||
|
|
||||||
|
street2 = d.pop("street2", UNSET)
|
||||||
|
|
||||||
|
_updated_at = d.pop("updated_at", UNSET)
|
||||||
|
updated_at: Union[Unset, datetime.datetime]
|
||||||
|
if isinstance(_updated_at, Unset):
|
||||||
|
updated_at = UNSET
|
||||||
|
else:
|
||||||
|
updated_at = isoparse(_updated_at)
|
||||||
|
|
||||||
|
user_id = d.pop("user_id", UNSET)
|
||||||
|
|
||||||
|
zip = d.pop("zip", UNSET)
|
||||||
|
|
||||||
|
address = cls(
|
||||||
|
city=city,
|
||||||
|
country=country,
|
||||||
|
created_at=created_at,
|
||||||
|
id=id,
|
||||||
|
state=state,
|
||||||
|
street1=street1,
|
||||||
|
street2=street2,
|
||||||
|
updated_at=updated_at,
|
||||||
|
user_id=user_id,
|
||||||
|
zip=zip,
|
||||||
|
)
|
||||||
|
|
||||||
|
address.additional_properties = d
|
||||||
|
return address
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
@ -1,7 +1,7 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class FileConversionStatus(str, Enum):
|
class APICallStatus(str, Enum):
|
||||||
QUEUED = 'Queued'
|
QUEUED = 'Queued'
|
||||||
UPLOADED = 'Uploaded'
|
UPLOADED = 'Uploaded'
|
||||||
IN_PROGRESS = 'In Progress'
|
IN_PROGRESS = 'In Progress'
|
@ -10,14 +10,14 @@ T = TypeVar("T", bound="ApiCallWithPriceResultsPage")
|
|||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class ApiCallWithPriceResultsPage:
|
class ApiCallWithPriceResultsPage:
|
||||||
""" """
|
""" """
|
||||||
from ..models import ApiCallWithPrice
|
from ..models.api_call_with_price import ApiCallWithPrice
|
||||||
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
|
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
|
||||||
next_page: Union[Unset, str] = UNSET
|
next_page: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
from ..models import ApiCallWithPrice
|
from ..models.api_call_with_price import ApiCallWithPrice
|
||||||
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
|
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
|
||||||
if not isinstance(self.items, Unset):
|
if not isinstance(self.items, Unset):
|
||||||
items = self.items
|
items = self.items
|
||||||
@ -36,7 +36,7 @@ class ApiCallWithPriceResultsPage:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
d = src_dict.copy()
|
d = src_dict.copy()
|
||||||
from ..models import ApiCallWithPrice
|
from ..models.api_call_with_price import ApiCallWithPrice
|
||||||
items = cast(List[ApiCallWithPrice], d.pop("items", UNSET))
|
items = cast(List[ApiCallWithPrice], d.pop("items", UNSET))
|
||||||
|
|
||||||
next_page = d.pop("next_page", UNSET)
|
next_page = d.pop("next_page", UNSET)
|
||||||
|
@ -10,14 +10,14 @@ T = TypeVar("T", bound="ApiTokenResultsPage")
|
|||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class ApiTokenResultsPage:
|
class ApiTokenResultsPage:
|
||||||
""" """
|
""" """
|
||||||
from ..models import ApiToken
|
from ..models.api_token import ApiToken
|
||||||
items: Union[Unset, List[ApiToken]] = UNSET
|
items: Union[Unset, List[ApiToken]] = UNSET
|
||||||
next_page: Union[Unset, str] = UNSET
|
next_page: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
from ..models import ApiToken
|
from ..models.api_token import ApiToken
|
||||||
items: Union[Unset, List[ApiToken]] = UNSET
|
items: Union[Unset, List[ApiToken]] = UNSET
|
||||||
if not isinstance(self.items, Unset):
|
if not isinstance(self.items, Unset):
|
||||||
items = self.items
|
items = self.items
|
||||||
@ -36,7 +36,7 @@ class ApiTokenResultsPage:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
d = src_dict.copy()
|
d = src_dict.copy()
|
||||||
from ..models import ApiToken
|
from ..models.api_token import ApiToken
|
||||||
items = cast(List[ApiToken], d.pop("items", UNSET))
|
items = cast(List[ApiToken], d.pop("items", UNSET))
|
||||||
|
|
||||||
next_page = d.pop("next_page", UNSET)
|
next_page = d.pop("next_page", UNSET)
|
||||||
|
76
kittycad/models/billing_info.py
Normal file
76
kittycad/models/billing_info.py
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..models.address import Address
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="BillingInfo")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class BillingInfo:
|
||||||
|
""" """
|
||||||
|
address: Union[Unset, Address] = UNSET
|
||||||
|
name: Union[Unset, str] = UNSET
|
||||||
|
phone: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
address: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.address, Unset):
|
||||||
|
address = self.address.value
|
||||||
|
name = self.name
|
||||||
|
phone = self.phone
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if address is not UNSET:
|
||||||
|
field_dict['address'] = address
|
||||||
|
if name is not UNSET:
|
||||||
|
field_dict['name'] = name
|
||||||
|
if phone is not UNSET:
|
||||||
|
field_dict['phone'] = phone
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
_address = d.pop("address", UNSET)
|
||||||
|
address: Union[Unset, Address]
|
||||||
|
if isinstance(_address, Unset):
|
||||||
|
address = UNSET
|
||||||
|
else:
|
||||||
|
address = Address(_address)
|
||||||
|
|
||||||
|
name = d.pop("name", UNSET)
|
||||||
|
|
||||||
|
phone = d.pop("phone", UNSET)
|
||||||
|
|
||||||
|
billing_info = cls(
|
||||||
|
address=address,
|
||||||
|
name=name,
|
||||||
|
phone=phone,
|
||||||
|
)
|
||||||
|
|
||||||
|
billing_info.additional_properties = d
|
||||||
|
return billing_info
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
54
kittycad/models/cache_metadata.py
Normal file
54
kittycad/models/cache_metadata.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="CacheMetadata")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class CacheMetadata:
|
||||||
|
""" """
|
||||||
|
ok: Union[Unset, bool] = False
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
ok = self.ok
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if ok is not UNSET:
|
||||||
|
field_dict['ok'] = ok
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
ok = d.pop("ok", UNSET)
|
||||||
|
|
||||||
|
cache_metadata = cls(
|
||||||
|
ok=ok,
|
||||||
|
)
|
||||||
|
|
||||||
|
cache_metadata.additional_properties = d
|
||||||
|
return cache_metadata
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
111
kittycad/models/card_details.py
Normal file
111
kittycad/models/card_details.py
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..models.payment_method_card_checks import PaymentMethodCardChecks
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="CardDetails")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class CardDetails:
|
||||||
|
""" """
|
||||||
|
brand: Union[Unset, str] = UNSET
|
||||||
|
checks: Union[Unset, PaymentMethodCardChecks] = UNSET
|
||||||
|
country: Union[Unset, str] = UNSET
|
||||||
|
exp_month: Union[Unset, int] = UNSET
|
||||||
|
exp_year: Union[Unset, int] = UNSET
|
||||||
|
fingerprint: Union[Unset, str] = UNSET
|
||||||
|
funding: Union[Unset, str] = UNSET
|
||||||
|
last4: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
brand = self.brand
|
||||||
|
checks: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.checks, Unset):
|
||||||
|
checks = self.checks.value
|
||||||
|
country = self.country
|
||||||
|
exp_month = self.exp_month
|
||||||
|
exp_year = self.exp_year
|
||||||
|
fingerprint = self.fingerprint
|
||||||
|
funding = self.funding
|
||||||
|
last4 = self.last4
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if brand is not UNSET:
|
||||||
|
field_dict['brand'] = brand
|
||||||
|
if checks is not UNSET:
|
||||||
|
field_dict['checks'] = checks
|
||||||
|
if country is not UNSET:
|
||||||
|
field_dict['country'] = country
|
||||||
|
if exp_month is not UNSET:
|
||||||
|
field_dict['exp_month'] = exp_month
|
||||||
|
if exp_year is not UNSET:
|
||||||
|
field_dict['exp_year'] = exp_year
|
||||||
|
if fingerprint is not UNSET:
|
||||||
|
field_dict['fingerprint'] = fingerprint
|
||||||
|
if funding is not UNSET:
|
||||||
|
field_dict['funding'] = funding
|
||||||
|
if last4 is not UNSET:
|
||||||
|
field_dict['last4'] = last4
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
brand = d.pop("brand", UNSET)
|
||||||
|
|
||||||
|
_checks = d.pop("checks", UNSET)
|
||||||
|
checks: Union[Unset, PaymentMethodCardChecks]
|
||||||
|
if isinstance(_checks, Unset):
|
||||||
|
checks = UNSET
|
||||||
|
else:
|
||||||
|
checks = PaymentMethodCardChecks(_checks)
|
||||||
|
|
||||||
|
country = d.pop("country", UNSET)
|
||||||
|
|
||||||
|
exp_month = d.pop("exp_month", UNSET)
|
||||||
|
|
||||||
|
exp_year = d.pop("exp_year", UNSET)
|
||||||
|
|
||||||
|
fingerprint = d.pop("fingerprint", UNSET)
|
||||||
|
|
||||||
|
funding = d.pop("funding", UNSET)
|
||||||
|
|
||||||
|
last4 = d.pop("last4", UNSET)
|
||||||
|
|
||||||
|
card_details = cls(
|
||||||
|
brand=brand,
|
||||||
|
checks=checks,
|
||||||
|
country=country,
|
||||||
|
exp_month=exp_month,
|
||||||
|
exp_year=exp_year,
|
||||||
|
fingerprint=fingerprint,
|
||||||
|
funding=funding,
|
||||||
|
last4=last4,
|
||||||
|
)
|
||||||
|
|
||||||
|
card_details.additional_properties = d
|
||||||
|
return card_details
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
11
kittycad/models/code_language.py
Normal file
11
kittycad/models/code_language.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class CodeLanguage(str, Enum):
|
||||||
|
GO = 'go'
|
||||||
|
RUST = 'rust'
|
||||||
|
PYTHON = 'python'
|
||||||
|
NODE = 'node'
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return str(self.value)
|
@ -4,50 +4,52 @@ import attr
|
|||||||
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="FileConversionResultsPage")
|
T = TypeVar("T", bound="CodeOutput")
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class FileConversionResultsPage:
|
class CodeOutput:
|
||||||
""" """
|
""" """
|
||||||
from ..models import FileConversion
|
output: Union[Unset, str] = UNSET
|
||||||
items: Union[Unset, List[FileConversion]] = UNSET
|
stderr: Union[Unset, str] = UNSET
|
||||||
next_page: Union[Unset, str] = UNSET
|
stdout: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
from ..models import FileConversion
|
output = self.output
|
||||||
items: Union[Unset, List[FileConversion]] = UNSET
|
stderr = self.stderr
|
||||||
if not isinstance(self.items, Unset):
|
stdout = self.stdout
|
||||||
items = self.items
|
|
||||||
next_page = self.next_page
|
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
field_dict.update({})
|
field_dict.update({})
|
||||||
if items is not UNSET:
|
if output is not UNSET:
|
||||||
field_dict['items'] = items
|
field_dict['output'] = output
|
||||||
if next_page is not UNSET:
|
if stderr is not UNSET:
|
||||||
field_dict['next_page'] = next_page
|
field_dict['stderr'] = stderr
|
||||||
|
if stdout is not UNSET:
|
||||||
|
field_dict['stdout'] = stdout
|
||||||
|
|
||||||
return field_dict
|
return field_dict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
d = src_dict.copy()
|
d = src_dict.copy()
|
||||||
from ..models import FileConversion
|
output = d.pop("output", UNSET)
|
||||||
items = cast(List[FileConversion], d.pop("items", UNSET))
|
|
||||||
|
|
||||||
next_page = d.pop("next_page", UNSET)
|
stderr = d.pop("stderr", UNSET)
|
||||||
|
|
||||||
file_conversion_results_page = cls(
|
stdout = d.pop("stdout", UNSET)
|
||||||
items=items,
|
|
||||||
next_page=next_page,
|
code_output = cls(
|
||||||
|
output=output,
|
||||||
|
stderr=stderr,
|
||||||
|
stdout=stdout,
|
||||||
)
|
)
|
||||||
|
|
||||||
file_conversion_results_page.additional_properties = d
|
code_output.additional_properties = d
|
||||||
return file_conversion_results_page
|
return code_output
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
@ -11,18 +11,18 @@ from ..models.leaf_node import LeafNode
|
|||||||
from ..models.duration import Duration
|
from ..models.duration import Duration
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="NatsConnection")
|
T = TypeVar("T", bound="Connection")
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class NatsConnection:
|
class Connection:
|
||||||
""" """
|
""" """
|
||||||
auth_timeout: Union[Unset, int] = UNSET
|
auth_timeout: Union[Unset, int] = UNSET
|
||||||
cluster: Union[Unset, Cluster] = UNSET
|
cluster: Union[Unset, Cluster] = UNSET
|
||||||
config_load_time: Union[Unset, datetime.datetime] = UNSET
|
config_load_time: Union[Unset, datetime.datetime] = UNSET
|
||||||
connections: Union[Unset, int] = UNSET
|
connections: Union[Unset, int] = UNSET
|
||||||
cores: Union[Unset, int] = UNSET
|
cores: Union[Unset, int] = UNSET
|
||||||
cpu: Union[Unset, int] = UNSET
|
cpu: Union[Unset, float] = UNSET
|
||||||
gateway: Union[Unset, Gateway] = UNSET
|
gateway: Union[Unset, Gateway] = UNSET
|
||||||
git_commit: Union[Unset, str] = UNSET
|
git_commit: Union[Unset, str] = UNSET
|
||||||
go: Union[Unset, str] = UNSET
|
go: Union[Unset, str] = UNSET
|
146
kittycad/models/currency.py
Normal file
146
kittycad/models/currency.py
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class Currency(str, Enum):
|
||||||
|
AED = 'aed'
|
||||||
|
AFN = 'afn'
|
||||||
|
ALL = 'all'
|
||||||
|
AMD = 'amd'
|
||||||
|
ANG = 'ang'
|
||||||
|
AOA = 'aoa'
|
||||||
|
ARS = 'ars'
|
||||||
|
AUD = 'aud'
|
||||||
|
AWG = 'awg'
|
||||||
|
AZN = 'azn'
|
||||||
|
BAM = 'bam'
|
||||||
|
BBD = 'bbd'
|
||||||
|
BDT = 'bdt'
|
||||||
|
BGN = 'bgn'
|
||||||
|
BIF = 'bif'
|
||||||
|
BMD = 'bmd'
|
||||||
|
BND = 'bnd'
|
||||||
|
BOB = 'bob'
|
||||||
|
BRL = 'brl'
|
||||||
|
BSD = 'bsd'
|
||||||
|
BWP = 'bwp'
|
||||||
|
BZD = 'bzd'
|
||||||
|
CAD = 'cad'
|
||||||
|
CDF = 'cdf'
|
||||||
|
CHF = 'chf'
|
||||||
|
CLP = 'clp'
|
||||||
|
CNY = 'cny'
|
||||||
|
COP = 'cop'
|
||||||
|
CRC = 'crc'
|
||||||
|
CVE = 'cve'
|
||||||
|
CZK = 'czk'
|
||||||
|
DJF = 'djf'
|
||||||
|
DKK = 'dkk'
|
||||||
|
DOP = 'dop'
|
||||||
|
DZD = 'dzd'
|
||||||
|
EEK = 'eek'
|
||||||
|
EGP = 'egp'
|
||||||
|
ETB = 'etb'
|
||||||
|
EUR = 'eur'
|
||||||
|
FJD = 'fjd'
|
||||||
|
FKP = 'fkp'
|
||||||
|
GBP = 'gbp'
|
||||||
|
GEL = 'gel'
|
||||||
|
GIP = 'gip'
|
||||||
|
GMD = 'gmd'
|
||||||
|
GNF = 'gnf'
|
||||||
|
GTQ = 'gtq'
|
||||||
|
GYD = 'gyd'
|
||||||
|
HKD = 'hkd'
|
||||||
|
HNL = 'hnl'
|
||||||
|
HRK = 'hrk'
|
||||||
|
HTG = 'htg'
|
||||||
|
HUF = 'huf'
|
||||||
|
IDR = 'idr'
|
||||||
|
ILS = 'ils'
|
||||||
|
INR = 'inr'
|
||||||
|
ISK = 'isk'
|
||||||
|
JMD = 'jmd'
|
||||||
|
JPY = 'jpy'
|
||||||
|
KES = 'kes'
|
||||||
|
KGS = 'kgs'
|
||||||
|
KHR = 'khr'
|
||||||
|
KMF = 'kmf'
|
||||||
|
KRW = 'krw'
|
||||||
|
KYD = 'kyd'
|
||||||
|
KZT = 'kzt'
|
||||||
|
LAK = 'lak'
|
||||||
|
LBP = 'lbp'
|
||||||
|
LKR = 'lkr'
|
||||||
|
LRD = 'lrd'
|
||||||
|
LSL = 'lsl'
|
||||||
|
LTL = 'ltl'
|
||||||
|
LVL = 'lvl'
|
||||||
|
MAD = 'mad'
|
||||||
|
MDL = 'mdl'
|
||||||
|
MGA = 'mga'
|
||||||
|
MKD = 'mkd'
|
||||||
|
MNT = 'mnt'
|
||||||
|
MOP = 'mop'
|
||||||
|
MRO = 'mro'
|
||||||
|
MUR = 'mur'
|
||||||
|
MVR = 'mvr'
|
||||||
|
MWK = 'mwk'
|
||||||
|
MXN = 'mxn'
|
||||||
|
MYR = 'myr'
|
||||||
|
MZN = 'mzn'
|
||||||
|
NAD = 'nad'
|
||||||
|
NGN = 'ngn'
|
||||||
|
NIO = 'nio'
|
||||||
|
NOK = 'nok'
|
||||||
|
NPR = 'npr'
|
||||||
|
NZD = 'nzd'
|
||||||
|
PAB = 'pab'
|
||||||
|
PEN = 'pen'
|
||||||
|
PGK = 'pgk'
|
||||||
|
PHP = 'php'
|
||||||
|
PKR = 'pkr'
|
||||||
|
PLN = 'pln'
|
||||||
|
PYG = 'pyg'
|
||||||
|
QAR = 'qar'
|
||||||
|
RON = 'ron'
|
||||||
|
RSD = 'rsd'
|
||||||
|
RUB = 'rub'
|
||||||
|
RWF = 'rwf'
|
||||||
|
SAR = 'sar'
|
||||||
|
SBD = 'sbd'
|
||||||
|
SCR = 'scr'
|
||||||
|
SEK = 'sek'
|
||||||
|
SGD = 'sgd'
|
||||||
|
SHP = 'shp'
|
||||||
|
SLL = 'sll'
|
||||||
|
SOS = 'sos'
|
||||||
|
SRD = 'srd'
|
||||||
|
STD = 'std'
|
||||||
|
SVC = 'svc'
|
||||||
|
SZL = 'szl'
|
||||||
|
THB = 'thb'
|
||||||
|
TJS = 'tjs'
|
||||||
|
TOP = 'top'
|
||||||
|
TRY = 'try'
|
||||||
|
TTD = 'ttd'
|
||||||
|
TWD = 'twd'
|
||||||
|
TZS = 'tzs'
|
||||||
|
UAH = 'uah'
|
||||||
|
UGX = 'ugx'
|
||||||
|
USD = 'usd'
|
||||||
|
UYU = 'uyu'
|
||||||
|
UZS = 'uzs'
|
||||||
|
VEF = 'vef'
|
||||||
|
VND = 'vnd'
|
||||||
|
VUV = 'vuv'
|
||||||
|
WST = 'wst'
|
||||||
|
XAF = 'xaf'
|
||||||
|
XCD = 'xcd'
|
||||||
|
XOF = 'xof'
|
||||||
|
XPF = 'xpf'
|
||||||
|
YER = 'yer'
|
||||||
|
ZAR = 'zar'
|
||||||
|
ZMW = 'zmw'
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return str(self.value)
|
23
kittycad/models/customer.py
Normal file
23
kittycad/models/customer.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import datetime
|
||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.address import Address
|
||||||
|
from ..models.currency import Currency
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="Customer")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class Customer:
|
||||||
|
""" """
|
||||||
|
address: Union[Unset, Address] = UNSET
|
||||||
|
balance: Union[Unset, int] = UNSET
|
||||||
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
currency: Union[Unset, Currency] = UNSET
|
||||||
|
delinquent: Union[Unset, bool] = False
|
||||||
|
email: Union[Unset, str] = UNSET
|
||||||
|
id: Union[Unset, str] = UNSET
|
@ -3,7 +3,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|||||||
import attr
|
import attr
|
||||||
|
|
||||||
from ..models.file_system_metadata import FileSystemMetadata
|
from ..models.file_system_metadata import FileSystemMetadata
|
||||||
from ..models.nats_connection import NatsConnection
|
from ..models.connection import Connection
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="EngineMetadata")
|
T = TypeVar("T", bound="EngineMetadata")
|
||||||
@ -15,7 +15,7 @@ class EngineMetadata:
|
|||||||
async_jobs_running: Union[Unset, bool] = False
|
async_jobs_running: Union[Unset, bool] = False
|
||||||
fs: Union[Unset, FileSystemMetadata] = UNSET
|
fs: Union[Unset, FileSystemMetadata] = UNSET
|
||||||
git_hash: Union[Unset, str] = UNSET
|
git_hash: Union[Unset, str] = UNSET
|
||||||
nats: Union[Unset, NatsConnection] = UNSET
|
pubsub: Union[Unset, Connection] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
@ -25,9 +25,9 @@ class EngineMetadata:
|
|||||||
if not isinstance(self.fs, Unset):
|
if not isinstance(self.fs, Unset):
|
||||||
fs = self.fs.value
|
fs = self.fs.value
|
||||||
git_hash = self.git_hash
|
git_hash = self.git_hash
|
||||||
nats: Union[Unset, str] = UNSET
|
pubsub: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.nats, Unset):
|
if not isinstance(self.pubsub, Unset):
|
||||||
nats = self.nats.value
|
pubsub = self.pubsub.value
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
@ -38,8 +38,8 @@ class EngineMetadata:
|
|||||||
field_dict['fs'] = fs
|
field_dict['fs'] = fs
|
||||||
if git_hash is not UNSET:
|
if git_hash is not UNSET:
|
||||||
field_dict['git_hash'] = git_hash
|
field_dict['git_hash'] = git_hash
|
||||||
if nats is not UNSET:
|
if pubsub is not UNSET:
|
||||||
field_dict['nats'] = nats
|
field_dict['pubsub'] = pubsub
|
||||||
|
|
||||||
return field_dict
|
return field_dict
|
||||||
|
|
||||||
@ -57,18 +57,18 @@ class EngineMetadata:
|
|||||||
|
|
||||||
git_hash = d.pop("git_hash", UNSET)
|
git_hash = d.pop("git_hash", UNSET)
|
||||||
|
|
||||||
_nats = d.pop("nats", UNSET)
|
_pubsub = d.pop("pubsub", UNSET)
|
||||||
nats: Union[Unset, NatsConnection]
|
pubsub: Union[Unset, Connection]
|
||||||
if isinstance(_nats, Unset):
|
if isinstance(_pubsub, Unset):
|
||||||
nats = UNSET
|
pubsub = UNSET
|
||||||
else:
|
else:
|
||||||
nats = NatsConnection(_nats)
|
pubsub = Connection(_pubsub)
|
||||||
|
|
||||||
engine_metadata = cls(
|
engine_metadata = cls(
|
||||||
async_jobs_running=async_jobs_running,
|
async_jobs_running=async_jobs_running,
|
||||||
fs=fs,
|
fs=fs,
|
||||||
git_hash=git_hash,
|
git_hash=git_hash,
|
||||||
nats=nats,
|
pubsub=pubsub,
|
||||||
)
|
)
|
||||||
|
|
||||||
engine_metadata.additional_properties = d
|
engine_metadata.additional_properties = d
|
||||||
|
10
kittycad/models/environment.py
Normal file
10
kittycad/models/environment.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class Environment(str, Enum):
|
||||||
|
DEVELOPMENT = 'DEVELOPMENT'
|
||||||
|
PREVIEW = 'PREVIEW'
|
||||||
|
PRODUCTION = 'PRODUCTION'
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return str(self.value)
|
@ -10,14 +10,14 @@ T = TypeVar("T", bound="ExtendedUserResultsPage")
|
|||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class ExtendedUserResultsPage:
|
class ExtendedUserResultsPage:
|
||||||
""" """
|
""" """
|
||||||
from ..models import ExtendedUser
|
from ..models.extended_user import ExtendedUser
|
||||||
items: Union[Unset, List[ExtendedUser]] = UNSET
|
items: Union[Unset, List[ExtendedUser]] = UNSET
|
||||||
next_page: Union[Unset, str] = UNSET
|
next_page: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
from ..models import ExtendedUser
|
from ..models.extended_user import ExtendedUser
|
||||||
items: Union[Unset, List[ExtendedUser]] = UNSET
|
items: Union[Unset, List[ExtendedUser]] = UNSET
|
||||||
if not isinstance(self.items, Unset):
|
if not isinstance(self.items, Unset):
|
||||||
items = self.items
|
items = self.items
|
||||||
@ -36,7 +36,7 @@ class ExtendedUserResultsPage:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
d = src_dict.copy()
|
d = src_dict.copy()
|
||||||
from ..models import ExtendedUser
|
from ..models.extended_user import ExtendedUser
|
||||||
items = cast(List[ExtendedUser], d.pop("items", UNSET))
|
items = cast(List[ExtendedUser], d.pop("items", UNSET))
|
||||||
|
|
||||||
next_page = d.pop("next_page", UNSET)
|
next_page = d.pop("next_page", UNSET)
|
||||||
|
@ -5,9 +5,9 @@ import attr
|
|||||||
from dateutil.parser import isoparse
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
from ..models.uuid import Uuid
|
from ..models.uuid import Uuid
|
||||||
from ..models.file_conversion_output_format import FileConversionOutputFormat
|
from ..models.file_output_format import FileOutputFormat
|
||||||
from ..models.file_conversion_source_format import FileConversionSourceFormat
|
from ..models.file_source_format import FileSourceFormat
|
||||||
from ..models.file_conversion_status import FileConversionStatus
|
from ..models.api_call_status import APICallStatus
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="FileConversion")
|
T = TypeVar("T", bound="FileConversion")
|
||||||
@ -19,15 +19,13 @@ class FileConversion:
|
|||||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
id: Union[Unset, Uuid] = UNSET
|
id: Union[Unset, Uuid] = UNSET
|
||||||
output_file_link: Union[Unset, str] = UNSET
|
output: Union[Unset, str] = UNSET
|
||||||
output_format: Union[Unset, FileConversionOutputFormat] = UNSET
|
output_format: Union[Unset, FileOutputFormat] = UNSET
|
||||||
src_file_link: Union[Unset, str] = UNSET
|
src_format: Union[Unset, FileSourceFormat] = UNSET
|
||||||
src_format: Union[Unset, FileConversionSourceFormat] = UNSET
|
|
||||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
status: Union[Unset, FileConversionStatus] = UNSET
|
status: Union[Unset, APICallStatus] = UNSET
|
||||||
updated_at: Union[Unset, datetime.datetime] = UNSET
|
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
user_id: Union[Unset, str] = UNSET
|
user_id: Union[Unset, str] = UNSET
|
||||||
worker: Union[Unset, str] = UNSET
|
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
@ -41,11 +39,10 @@ class FileConversion:
|
|||||||
id: Union[Unset, str] = UNSET
|
id: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.id, Unset):
|
if not isinstance(self.id, Unset):
|
||||||
id = self.id.value
|
id = self.id.value
|
||||||
output_file_link = self.output_file_link
|
output = self.output
|
||||||
output_format: Union[Unset, str] = UNSET
|
output_format: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.output_format, Unset):
|
if not isinstance(self.output_format, Unset):
|
||||||
output_format = self.output_format.value
|
output_format = self.output_format.value
|
||||||
src_file_link = self.src_file_link
|
|
||||||
src_format: Union[Unset, str] = UNSET
|
src_format: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.src_format, Unset):
|
if not isinstance(self.src_format, Unset):
|
||||||
src_format = self.src_format.value
|
src_format = self.src_format.value
|
||||||
@ -59,7 +56,6 @@ class FileConversion:
|
|||||||
if not isinstance(self.updated_at, Unset):
|
if not isinstance(self.updated_at, Unset):
|
||||||
updated_at = self.updated_at.isoformat()
|
updated_at = self.updated_at.isoformat()
|
||||||
user_id = self.user_id
|
user_id = self.user_id
|
||||||
worker = self.worker
|
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
@ -70,12 +66,10 @@ class FileConversion:
|
|||||||
field_dict['created_at'] = created_at
|
field_dict['created_at'] = created_at
|
||||||
if id is not UNSET:
|
if id is not UNSET:
|
||||||
field_dict['id'] = id
|
field_dict['id'] = id
|
||||||
if output_file_link is not UNSET:
|
if output is not UNSET:
|
||||||
field_dict['output_file_link'] = output_file_link
|
field_dict['output'] = output
|
||||||
if output_format is not UNSET:
|
if output_format is not UNSET:
|
||||||
field_dict['output_format'] = output_format
|
field_dict['output_format'] = output_format
|
||||||
if src_file_link is not UNSET:
|
|
||||||
field_dict['src_file_link'] = src_file_link
|
|
||||||
if src_format is not UNSET:
|
if src_format is not UNSET:
|
||||||
field_dict['src_format'] = src_format
|
field_dict['src_format'] = src_format
|
||||||
if started_at is not UNSET:
|
if started_at is not UNSET:
|
||||||
@ -86,8 +80,6 @@ class FileConversion:
|
|||||||
field_dict['updated_at'] = updated_at
|
field_dict['updated_at'] = updated_at
|
||||||
if user_id is not UNSET:
|
if user_id is not UNSET:
|
||||||
field_dict['user_id'] = user_id
|
field_dict['user_id'] = user_id
|
||||||
if worker is not UNSET:
|
|
||||||
field_dict['worker'] = worker
|
|
||||||
|
|
||||||
return field_dict
|
return field_dict
|
||||||
|
|
||||||
@ -115,23 +107,21 @@ class FileConversion:
|
|||||||
else:
|
else:
|
||||||
id = Uuid(_id)
|
id = Uuid(_id)
|
||||||
|
|
||||||
output_file_link = d.pop("output_file_link", UNSET)
|
output = d.pop("output", UNSET)
|
||||||
|
|
||||||
_output_format = d.pop("output_format", UNSET)
|
_output_format = d.pop("output_format", UNSET)
|
||||||
output_format: Union[Unset, FileConversionOutputFormat]
|
output_format: Union[Unset, FileOutputFormat]
|
||||||
if isinstance(_output_format, Unset):
|
if isinstance(_output_format, Unset):
|
||||||
output_format = UNSET
|
output_format = UNSET
|
||||||
else:
|
else:
|
||||||
output_format = FileConversionOutputFormat(_output_format)
|
output_format = FileOutputFormat(_output_format)
|
||||||
|
|
||||||
src_file_link = d.pop("src_file_link", UNSET)
|
|
||||||
|
|
||||||
_src_format = d.pop("src_format", UNSET)
|
_src_format = d.pop("src_format", UNSET)
|
||||||
src_format: Union[Unset, FileConversionSourceFormat]
|
src_format: Union[Unset, FileSourceFormat]
|
||||||
if isinstance(_src_format, Unset):
|
if isinstance(_src_format, Unset):
|
||||||
src_format = UNSET
|
src_format = UNSET
|
||||||
else:
|
else:
|
||||||
src_format = FileConversionSourceFormat(_src_format)
|
src_format = FileSourceFormat(_src_format)
|
||||||
|
|
||||||
_started_at = d.pop("started_at", UNSET)
|
_started_at = d.pop("started_at", UNSET)
|
||||||
started_at: Union[Unset, datetime.datetime]
|
started_at: Union[Unset, datetime.datetime]
|
||||||
@ -141,11 +131,11 @@ class FileConversion:
|
|||||||
started_at = isoparse(_started_at)
|
started_at = isoparse(_started_at)
|
||||||
|
|
||||||
_status = d.pop("status", UNSET)
|
_status = d.pop("status", UNSET)
|
||||||
status: Union[Unset, FileConversionStatus]
|
status: Union[Unset, APICallStatus]
|
||||||
if isinstance(_status, Unset):
|
if isinstance(_status, Unset):
|
||||||
status = UNSET
|
status = UNSET
|
||||||
else:
|
else:
|
||||||
status = FileConversionStatus(_status)
|
status = APICallStatus(_status)
|
||||||
|
|
||||||
_updated_at = d.pop("updated_at", UNSET)
|
_updated_at = d.pop("updated_at", UNSET)
|
||||||
updated_at: Union[Unset, datetime.datetime]
|
updated_at: Union[Unset, datetime.datetime]
|
||||||
@ -156,21 +146,17 @@ class FileConversion:
|
|||||||
|
|
||||||
user_id = d.pop("user_id", UNSET)
|
user_id = d.pop("user_id", UNSET)
|
||||||
|
|
||||||
worker = d.pop("worker", UNSET)
|
|
||||||
|
|
||||||
file_conversion = cls(
|
file_conversion = cls(
|
||||||
completed_at=completed_at,
|
completed_at=completed_at,
|
||||||
created_at=created_at,
|
created_at=created_at,
|
||||||
id=id,
|
id=id,
|
||||||
output_file_link=output_file_link,
|
output=output,
|
||||||
output_format=output_format,
|
output_format=output_format,
|
||||||
src_file_link=src_file_link,
|
|
||||||
src_format=src_format,
|
src_format=src_format,
|
||||||
started_at=started_at,
|
started_at=started_at,
|
||||||
status=status,
|
status=status,
|
||||||
updated_at=updated_at,
|
updated_at=updated_at,
|
||||||
user_id=user_id,
|
user_id=user_id,
|
||||||
worker=worker,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
file_conversion.additional_properties = d
|
file_conversion.additional_properties = d
|
||||||
|
@ -5,25 +5,25 @@ import attr
|
|||||||
from dateutil.parser import isoparse
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
from ..models.uuid import Uuid
|
from ..models.uuid import Uuid
|
||||||
from ..models.file_conversion_output_format import FileConversionOutputFormat
|
from ..models.file_source_format import FileSourceFormat
|
||||||
from ..models.file_conversion_source_format import FileConversionSourceFormat
|
from ..models.api_call_status import APICallStatus
|
||||||
from ..models.file_conversion_status import FileConversionStatus
|
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="FileConversionWithOutput")
|
T = TypeVar("T", bound="FileMass")
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class FileConversionWithOutput:
|
class FileMass:
|
||||||
""" """
|
""" """
|
||||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
error: Union[Unset, str] = UNSET
|
||||||
id: Union[Unset, Uuid] = UNSET
|
id: Union[Unset, Uuid] = UNSET
|
||||||
output: Union[Unset, str] = UNSET
|
mass: Union[Unset, float] = UNSET
|
||||||
output_format: Union[Unset, FileConversionOutputFormat] = UNSET
|
material_density: Union[Unset, float] = UNSET
|
||||||
src_format: Union[Unset, FileConversionSourceFormat] = UNSET
|
src_format: Union[Unset, FileSourceFormat] = UNSET
|
||||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
status: Union[Unset, FileConversionStatus] = UNSET
|
status: Union[Unset, APICallStatus] = UNSET
|
||||||
updated_at: Union[Unset, datetime.datetime] = UNSET
|
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
user_id: Union[Unset, str] = UNSET
|
user_id: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
@ -36,13 +36,12 @@ class FileConversionWithOutput:
|
|||||||
created_at: Union[Unset, str] = UNSET
|
created_at: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.created_at, Unset):
|
if not isinstance(self.created_at, Unset):
|
||||||
created_at = self.created_at.isoformat()
|
created_at = self.created_at.isoformat()
|
||||||
|
error = self.error
|
||||||
id: Union[Unset, str] = UNSET
|
id: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.id, Unset):
|
if not isinstance(self.id, Unset):
|
||||||
id = self.id.value
|
id = self.id.value
|
||||||
output = self.output
|
mass = self.mass
|
||||||
output_format: Union[Unset, str] = UNSET
|
material_density = self.material_density
|
||||||
if not isinstance(self.output_format, Unset):
|
|
||||||
output_format = self.output_format.value
|
|
||||||
src_format: Union[Unset, str] = UNSET
|
src_format: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.src_format, Unset):
|
if not isinstance(self.src_format, Unset):
|
||||||
src_format = self.src_format.value
|
src_format = self.src_format.value
|
||||||
@ -64,12 +63,14 @@ class FileConversionWithOutput:
|
|||||||
field_dict['completed_at'] = completed_at
|
field_dict['completed_at'] = completed_at
|
||||||
if created_at is not UNSET:
|
if created_at is not UNSET:
|
||||||
field_dict['created_at'] = created_at
|
field_dict['created_at'] = created_at
|
||||||
|
if error is not UNSET:
|
||||||
|
field_dict['error'] = error
|
||||||
if id is not UNSET:
|
if id is not UNSET:
|
||||||
field_dict['id'] = id
|
field_dict['id'] = id
|
||||||
if output is not UNSET:
|
if mass is not UNSET:
|
||||||
field_dict['output'] = output
|
field_dict['mass'] = mass
|
||||||
if output_format is not UNSET:
|
if material_density is not UNSET:
|
||||||
field_dict['output_format'] = output_format
|
field_dict['material_density'] = material_density
|
||||||
if src_format is not UNSET:
|
if src_format is not UNSET:
|
||||||
field_dict['src_format'] = src_format
|
field_dict['src_format'] = src_format
|
||||||
if started_at is not UNSET:
|
if started_at is not UNSET:
|
||||||
@ -100,6 +101,8 @@ class FileConversionWithOutput:
|
|||||||
else:
|
else:
|
||||||
created_at = isoparse(_created_at)
|
created_at = isoparse(_created_at)
|
||||||
|
|
||||||
|
error = d.pop("error", UNSET)
|
||||||
|
|
||||||
_id = d.pop("id", UNSET)
|
_id = d.pop("id", UNSET)
|
||||||
id: Union[Unset, Uuid]
|
id: Union[Unset, Uuid]
|
||||||
if isinstance(_id, Unset):
|
if isinstance(_id, Unset):
|
||||||
@ -107,21 +110,16 @@ class FileConversionWithOutput:
|
|||||||
else:
|
else:
|
||||||
id = Uuid(_id)
|
id = Uuid(_id)
|
||||||
|
|
||||||
output = d.pop("output", UNSET)
|
mass = d.pop("mass", UNSET)
|
||||||
|
|
||||||
_output_format = d.pop("output_format", UNSET)
|
material_density = d.pop("material_density", UNSET)
|
||||||
output_format: Union[Unset, FileConversionOutputFormat]
|
|
||||||
if isinstance(_output_format, Unset):
|
|
||||||
output_format = UNSET
|
|
||||||
else:
|
|
||||||
output_format = FileConversionOutputFormat(_output_format)
|
|
||||||
|
|
||||||
_src_format = d.pop("src_format", UNSET)
|
_src_format = d.pop("src_format", UNSET)
|
||||||
src_format: Union[Unset, FileConversionSourceFormat]
|
src_format: Union[Unset, FileSourceFormat]
|
||||||
if isinstance(_src_format, Unset):
|
if isinstance(_src_format, Unset):
|
||||||
src_format = UNSET
|
src_format = UNSET
|
||||||
else:
|
else:
|
||||||
src_format = FileConversionSourceFormat(_src_format)
|
src_format = FileSourceFormat(_src_format)
|
||||||
|
|
||||||
_started_at = d.pop("started_at", UNSET)
|
_started_at = d.pop("started_at", UNSET)
|
||||||
started_at: Union[Unset, datetime.datetime]
|
started_at: Union[Unset, datetime.datetime]
|
||||||
@ -131,11 +129,11 @@ class FileConversionWithOutput:
|
|||||||
started_at = isoparse(_started_at)
|
started_at = isoparse(_started_at)
|
||||||
|
|
||||||
_status = d.pop("status", UNSET)
|
_status = d.pop("status", UNSET)
|
||||||
status: Union[Unset, FileConversionStatus]
|
status: Union[Unset, APICallStatus]
|
||||||
if isinstance(_status, Unset):
|
if isinstance(_status, Unset):
|
||||||
status = UNSET
|
status = UNSET
|
||||||
else:
|
else:
|
||||||
status = FileConversionStatus(_status)
|
status = APICallStatus(_status)
|
||||||
|
|
||||||
_updated_at = d.pop("updated_at", UNSET)
|
_updated_at = d.pop("updated_at", UNSET)
|
||||||
updated_at: Union[Unset, datetime.datetime]
|
updated_at: Union[Unset, datetime.datetime]
|
||||||
@ -146,12 +144,13 @@ class FileConversionWithOutput:
|
|||||||
|
|
||||||
user_id = d.pop("user_id", UNSET)
|
user_id = d.pop("user_id", UNSET)
|
||||||
|
|
||||||
file_conversion_with_output = cls(
|
file_mass = cls(
|
||||||
completed_at=completed_at,
|
completed_at=completed_at,
|
||||||
created_at=created_at,
|
created_at=created_at,
|
||||||
|
error=error,
|
||||||
id=id,
|
id=id,
|
||||||
output=output,
|
mass=mass,
|
||||||
output_format=output_format,
|
material_density=material_density,
|
||||||
src_format=src_format,
|
src_format=src_format,
|
||||||
started_at=started_at,
|
started_at=started_at,
|
||||||
status=status,
|
status=status,
|
||||||
@ -159,8 +158,8 @@ class FileConversionWithOutput:
|
|||||||
user_id=user_id,
|
user_id=user_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
file_conversion_with_output.additional_properties = d
|
file_mass.additional_properties = d
|
||||||
return file_conversion_with_output
|
return file_mass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def additional_keys(self) -> List[str]:
|
def additional_keys(self) -> List[str]:
|
@ -1,7 +1,7 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class FileConversionOutputFormat(str, Enum):
|
class FileOutputFormat(str, Enum):
|
||||||
STL = 'stl'
|
STL = 'stl'
|
||||||
OBJ = 'obj'
|
OBJ = 'obj'
|
||||||
DAE = 'dae'
|
DAE = 'dae'
|
@ -1,7 +1,7 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class FileConversionSourceFormat(str, Enum):
|
class FileSourceFormat(str, Enum):
|
||||||
STL = 'stl'
|
STL = 'stl'
|
||||||
OBJ = 'obj'
|
OBJ = 'obj'
|
||||||
DAE = 'dae'
|
DAE = 'dae'
|
171
kittycad/models/file_volume.py
Normal file
171
kittycad/models/file_volume.py
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
import datetime
|
||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.uuid import Uuid
|
||||||
|
from ..models.file_source_format import FileSourceFormat
|
||||||
|
from ..models.api_call_status import APICallStatus
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="FileVolume")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class FileVolume:
|
||||||
|
""" """
|
||||||
|
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
error: Union[Unset, str] = UNSET
|
||||||
|
id: Union[Unset, Uuid] = UNSET
|
||||||
|
src_format: Union[Unset, FileSourceFormat] = UNSET
|
||||||
|
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
status: Union[Unset, APICallStatus] = UNSET
|
||||||
|
updated_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
user_id: Union[Unset, str] = UNSET
|
||||||
|
volume: Union[Unset, float] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
completed_at: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.completed_at, Unset):
|
||||||
|
completed_at = self.completed_at.isoformat()
|
||||||
|
created_at: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.created_at, Unset):
|
||||||
|
created_at = self.created_at.isoformat()
|
||||||
|
error = self.error
|
||||||
|
id: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.id, Unset):
|
||||||
|
id = self.id.value
|
||||||
|
src_format: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.src_format, Unset):
|
||||||
|
src_format = self.src_format.value
|
||||||
|
started_at: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.started_at, Unset):
|
||||||
|
started_at = self.started_at.isoformat()
|
||||||
|
status: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.status, Unset):
|
||||||
|
status = self.status.value
|
||||||
|
updated_at: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.updated_at, Unset):
|
||||||
|
updated_at = self.updated_at.isoformat()
|
||||||
|
user_id = self.user_id
|
||||||
|
volume = self.volume
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if completed_at is not UNSET:
|
||||||
|
field_dict['completed_at'] = completed_at
|
||||||
|
if created_at is not UNSET:
|
||||||
|
field_dict['created_at'] = created_at
|
||||||
|
if error is not UNSET:
|
||||||
|
field_dict['error'] = error
|
||||||
|
if id is not UNSET:
|
||||||
|
field_dict['id'] = id
|
||||||
|
if src_format is not UNSET:
|
||||||
|
field_dict['src_format'] = src_format
|
||||||
|
if started_at is not UNSET:
|
||||||
|
field_dict['started_at'] = started_at
|
||||||
|
if status is not UNSET:
|
||||||
|
field_dict['status'] = status
|
||||||
|
if updated_at is not UNSET:
|
||||||
|
field_dict['updated_at'] = updated_at
|
||||||
|
if user_id is not UNSET:
|
||||||
|
field_dict['user_id'] = user_id
|
||||||
|
if volume is not UNSET:
|
||||||
|
field_dict['volume'] = volume
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
_completed_at = d.pop("completed_at", UNSET)
|
||||||
|
completed_at: Union[Unset, datetime.datetime]
|
||||||
|
if isinstance(_completed_at, Unset):
|
||||||
|
completed_at = UNSET
|
||||||
|
else:
|
||||||
|
completed_at = isoparse(_completed_at)
|
||||||
|
|
||||||
|
_created_at = d.pop("created_at", UNSET)
|
||||||
|
created_at: Union[Unset, datetime.datetime]
|
||||||
|
if isinstance(_created_at, Unset):
|
||||||
|
created_at = UNSET
|
||||||
|
else:
|
||||||
|
created_at = isoparse(_created_at)
|
||||||
|
|
||||||
|
error = d.pop("error", UNSET)
|
||||||
|
|
||||||
|
_id = d.pop("id", UNSET)
|
||||||
|
id: Union[Unset, Uuid]
|
||||||
|
if isinstance(_id, Unset):
|
||||||
|
id = UNSET
|
||||||
|
else:
|
||||||
|
id = Uuid(_id)
|
||||||
|
|
||||||
|
_src_format = d.pop("src_format", UNSET)
|
||||||
|
src_format: Union[Unset, FileSourceFormat]
|
||||||
|
if isinstance(_src_format, Unset):
|
||||||
|
src_format = UNSET
|
||||||
|
else:
|
||||||
|
src_format = FileSourceFormat(_src_format)
|
||||||
|
|
||||||
|
_started_at = d.pop("started_at", UNSET)
|
||||||
|
started_at: Union[Unset, datetime.datetime]
|
||||||
|
if isinstance(_started_at, Unset):
|
||||||
|
started_at = UNSET
|
||||||
|
else:
|
||||||
|
started_at = isoparse(_started_at)
|
||||||
|
|
||||||
|
_status = d.pop("status", UNSET)
|
||||||
|
status: Union[Unset, APICallStatus]
|
||||||
|
if isinstance(_status, Unset):
|
||||||
|
status = UNSET
|
||||||
|
else:
|
||||||
|
status = APICallStatus(_status)
|
||||||
|
|
||||||
|
_updated_at = d.pop("updated_at", UNSET)
|
||||||
|
updated_at: Union[Unset, datetime.datetime]
|
||||||
|
if isinstance(_updated_at, Unset):
|
||||||
|
updated_at = UNSET
|
||||||
|
else:
|
||||||
|
updated_at = isoparse(_updated_at)
|
||||||
|
|
||||||
|
user_id = d.pop("user_id", UNSET)
|
||||||
|
|
||||||
|
volume = d.pop("volume", UNSET)
|
||||||
|
|
||||||
|
file_volume = cls(
|
||||||
|
completed_at=completed_at,
|
||||||
|
created_at=created_at,
|
||||||
|
error=error,
|
||||||
|
id=id,
|
||||||
|
src_format=src_format,
|
||||||
|
started_at=started_at,
|
||||||
|
status=status,
|
||||||
|
updated_at=updated_at,
|
||||||
|
user_id=user_id,
|
||||||
|
volume=volume,
|
||||||
|
)
|
||||||
|
|
||||||
|
file_volume.additional_properties = d
|
||||||
|
return file_volume
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
@ -1,4 +0,0 @@
|
|||||||
class http_req_stats(int):
|
|
||||||
|
|
||||||
def __int__(self) -> int:
|
|
||||||
return self
|
|
29
kittycad/models/invoice.py
Normal file
29
kittycad/models/invoice.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import datetime
|
||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.currency import Currency
|
||||||
|
from ..models.invoice_status import InvoiceStatus
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="Invoice")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class Invoice:
|
||||||
|
""" """
|
||||||
|
amount_due: Union[Unset, int] = UNSET
|
||||||
|
amount_paid: Union[Unset, int] = UNSET
|
||||||
|
amount_remaining: Union[Unset, int] = UNSET
|
||||||
|
attempt_count: Union[Unset, int] = UNSET
|
||||||
|
attempted: Union[Unset, bool] = False
|
||||||
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
currency: Union[Unset, Currency] = UNSET
|
||||||
|
description: Union[Unset, str] = UNSET
|
||||||
|
id: Union[Unset, str] = UNSET
|
||||||
|
invoice_pdf: Union[Unset, str] = UNSET
|
||||||
|
invoice_url: Union[Unset, str] = UNSET
|
||||||
|
from ..models.invoice_line_item import InvoiceLineItem
|
||||||
|
lines: Union[Unset, List[InvoiceLineItem]] = UNSET
|
18
kittycad/models/invoice_line_item.py
Normal file
18
kittycad/models/invoice_line_item.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..models.currency import Currency
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="InvoiceLineItem")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class InvoiceLineItem:
|
||||||
|
""" """
|
||||||
|
amount: Union[Unset, int] = UNSET
|
||||||
|
currency: Union[Unset, Currency] = UNSET
|
||||||
|
description: Union[Unset, str] = UNSET
|
||||||
|
id: Union[Unset, str] = UNSET
|
||||||
|
invoice_item: Union[Unset, str] = UNSET
|
13
kittycad/models/invoice_status.py
Normal file
13
kittycad/models/invoice_status.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class InvoiceStatus(str, Enum):
|
||||||
|
DELETED = 'deleted'
|
||||||
|
DRAFT = 'draft'
|
||||||
|
OPEN = 'open'
|
||||||
|
PAID = 'paid'
|
||||||
|
UNCOLLECTIBLE = 'uncollectible'
|
||||||
|
VOID = 'void'
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return str(self.value)
|
54
kittycad/models/login_params.py
Normal file
54
kittycad/models/login_params.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="LoginParams")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class LoginParams:
|
||||||
|
""" """
|
||||||
|
session: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
session = self.session
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if session is not UNSET:
|
||||||
|
field_dict['session'] = session
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
session = d.pop("session", UNSET)
|
||||||
|
|
||||||
|
login_params = cls(
|
||||||
|
session=session,
|
||||||
|
)
|
||||||
|
|
||||||
|
login_params.additional_properties = d
|
||||||
|
return login_params
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
@ -2,9 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|||||||
|
|
||||||
import attr
|
import attr
|
||||||
|
|
||||||
|
from ..models.cache_metadata import CacheMetadata
|
||||||
from ..models.engine_metadata import EngineMetadata
|
from ..models.engine_metadata import EngineMetadata
|
||||||
|
from ..models.environment import Environment
|
||||||
from ..models.file_system_metadata import FileSystemMetadata
|
from ..models.file_system_metadata import FileSystemMetadata
|
||||||
from ..models.nats_connection import NatsConnection
|
from ..models.connection import Connection
|
||||||
from ..types import UNSET, Unset
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
T = TypeVar("T", bound="Metadata")
|
T = TypeVar("T", bound="Metadata")
|
||||||
@ -13,42 +15,61 @@ T = TypeVar("T", bound="Metadata")
|
|||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class Metadata:
|
class Metadata:
|
||||||
""" """
|
""" """
|
||||||
|
cache: Union[Unset, CacheMetadata] = UNSET
|
||||||
engine: Union[Unset, EngineMetadata] = UNSET
|
engine: Union[Unset, EngineMetadata] = UNSET
|
||||||
|
environment: Union[Unset, Environment] = UNSET
|
||||||
fs: Union[Unset, FileSystemMetadata] = UNSET
|
fs: Union[Unset, FileSystemMetadata] = UNSET
|
||||||
git_hash: Union[Unset, str] = UNSET
|
git_hash: Union[Unset, str] = UNSET
|
||||||
nats: Union[Unset, NatsConnection] = UNSET
|
pubsub: Union[Unset, Connection] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
cache: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.cache, Unset):
|
||||||
|
cache = self.cache.value
|
||||||
engine: Union[Unset, str] = UNSET
|
engine: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.engine, Unset):
|
if not isinstance(self.engine, Unset):
|
||||||
engine = self.engine.value
|
engine = self.engine.value
|
||||||
|
environment: Union[Unset, str] = UNSET
|
||||||
|
if not isinstance(self.environment, Unset):
|
||||||
|
environment = self.environment.value
|
||||||
fs: Union[Unset, str] = UNSET
|
fs: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.fs, Unset):
|
if not isinstance(self.fs, Unset):
|
||||||
fs = self.fs.value
|
fs = self.fs.value
|
||||||
git_hash = self.git_hash
|
git_hash = self.git_hash
|
||||||
nats: Union[Unset, str] = UNSET
|
pubsub: Union[Unset, str] = UNSET
|
||||||
if not isinstance(self.nats, Unset):
|
if not isinstance(self.pubsub, Unset):
|
||||||
nats = self.nats.value
|
pubsub = self.pubsub.value
|
||||||
|
|
||||||
field_dict: Dict[str, Any] = {}
|
field_dict: Dict[str, Any] = {}
|
||||||
field_dict.update(self.additional_properties)
|
field_dict.update(self.additional_properties)
|
||||||
field_dict.update({})
|
field_dict.update({})
|
||||||
|
if cache is not UNSET:
|
||||||
|
field_dict['cache'] = cache
|
||||||
if engine is not UNSET:
|
if engine is not UNSET:
|
||||||
field_dict['engine'] = engine
|
field_dict['engine'] = engine
|
||||||
|
if environment is not UNSET:
|
||||||
|
field_dict['environment'] = environment
|
||||||
if fs is not UNSET:
|
if fs is not UNSET:
|
||||||
field_dict['fs'] = fs
|
field_dict['fs'] = fs
|
||||||
if git_hash is not UNSET:
|
if git_hash is not UNSET:
|
||||||
field_dict['git_hash'] = git_hash
|
field_dict['git_hash'] = git_hash
|
||||||
if nats is not UNSET:
|
if pubsub is not UNSET:
|
||||||
field_dict['nats'] = nats
|
field_dict['pubsub'] = pubsub
|
||||||
|
|
||||||
return field_dict
|
return field_dict
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
d = src_dict.copy()
|
d = src_dict.copy()
|
||||||
|
_cache = d.pop("cache", UNSET)
|
||||||
|
cache: Union[Unset, CacheMetadata]
|
||||||
|
if isinstance(_cache, Unset):
|
||||||
|
cache = UNSET
|
||||||
|
else:
|
||||||
|
cache = CacheMetadata(_cache)
|
||||||
|
|
||||||
_engine = d.pop("engine", UNSET)
|
_engine = d.pop("engine", UNSET)
|
||||||
engine: Union[Unset, EngineMetadata]
|
engine: Union[Unset, EngineMetadata]
|
||||||
if isinstance(_engine, Unset):
|
if isinstance(_engine, Unset):
|
||||||
@ -56,6 +77,13 @@ class Metadata:
|
|||||||
else:
|
else:
|
||||||
engine = EngineMetadata(_engine)
|
engine = EngineMetadata(_engine)
|
||||||
|
|
||||||
|
_environment = d.pop("environment", UNSET)
|
||||||
|
environment: Union[Unset, Environment]
|
||||||
|
if isinstance(_environment, Unset):
|
||||||
|
environment = UNSET
|
||||||
|
else:
|
||||||
|
environment = Environment(_environment)
|
||||||
|
|
||||||
_fs = d.pop("fs", UNSET)
|
_fs = d.pop("fs", UNSET)
|
||||||
fs: Union[Unset, FileSystemMetadata]
|
fs: Union[Unset, FileSystemMetadata]
|
||||||
if isinstance(_fs, Unset):
|
if isinstance(_fs, Unset):
|
||||||
@ -65,18 +93,20 @@ class Metadata:
|
|||||||
|
|
||||||
git_hash = d.pop("git_hash", UNSET)
|
git_hash = d.pop("git_hash", UNSET)
|
||||||
|
|
||||||
_nats = d.pop("nats", UNSET)
|
_pubsub = d.pop("pubsub", UNSET)
|
||||||
nats: Union[Unset, NatsConnection]
|
pubsub: Union[Unset, Connection]
|
||||||
if isinstance(_nats, Unset):
|
if isinstance(_pubsub, Unset):
|
||||||
nats = UNSET
|
pubsub = UNSET
|
||||||
else:
|
else:
|
||||||
nats = NatsConnection(_nats)
|
pubsub = Connection(_pubsub)
|
||||||
|
|
||||||
metadata = cls(
|
metadata = cls(
|
||||||
|
cache=cache,
|
||||||
engine=engine,
|
engine=engine,
|
||||||
|
environment=environment,
|
||||||
fs=fs,
|
fs=fs,
|
||||||
git_hash=git_hash,
|
git_hash=git_hash,
|
||||||
nats=nats,
|
pubsub=pubsub,
|
||||||
)
|
)
|
||||||
|
|
||||||
metadata.additional_properties = d
|
metadata.additional_properties = d
|
||||||
|
54
kittycad/models/payment_intent.py
Normal file
54
kittycad/models/payment_intent.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="PaymentIntent")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class PaymentIntent:
|
||||||
|
""" """
|
||||||
|
client_secret: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
client_secret = self.client_secret
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if client_secret is not UNSET:
|
||||||
|
field_dict['client_secret'] = client_secret
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
client_secret = d.pop("client_secret", UNSET)
|
||||||
|
|
||||||
|
payment_intent = cls(
|
||||||
|
client_secret=client_secret,
|
||||||
|
)
|
||||||
|
|
||||||
|
payment_intent.additional_properties = d
|
||||||
|
return payment_intent
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
21
kittycad/models/payment_method.py
Normal file
21
kittycad/models/payment_method.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import datetime
|
||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
from dateutil.parser import isoparse
|
||||||
|
|
||||||
|
from ..models.billing_info import BillingInfo
|
||||||
|
from ..models.card_details import CardDetails
|
||||||
|
from ..models.payment_method_type import PaymentMethodType
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="PaymentMethod")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class PaymentMethod:
|
||||||
|
""" """
|
||||||
|
billing_info: Union[Unset, BillingInfo] = UNSET
|
||||||
|
card: Union[Unset, CardDetails] = UNSET
|
||||||
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||||
|
id: Union[Unset, str] = UNSET
|
68
kittycad/models/payment_method_card_checks.py
Normal file
68
kittycad/models/payment_method_card_checks.py
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="PaymentMethodCardChecks")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class PaymentMethodCardChecks:
|
||||||
|
""" """
|
||||||
|
address_line1_check: Union[Unset, str] = UNSET
|
||||||
|
address_postal_code_check: Union[Unset, str] = UNSET
|
||||||
|
cvc_check: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
address_line1_check = self.address_line1_check
|
||||||
|
address_postal_code_check = self.address_postal_code_check
|
||||||
|
cvc_check = self.cvc_check
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if address_line1_check is not UNSET:
|
||||||
|
field_dict['address_line1_check'] = address_line1_check
|
||||||
|
if address_postal_code_check is not UNSET:
|
||||||
|
field_dict['address_postal_code_check'] = address_postal_code_check
|
||||||
|
if cvc_check is not UNSET:
|
||||||
|
field_dict['cvc_check'] = cvc_check
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
address_line1_check = d.pop("address_line1_check", UNSET)
|
||||||
|
|
||||||
|
address_postal_code_check = d.pop("address_postal_code_check", UNSET)
|
||||||
|
|
||||||
|
cvc_check = d.pop("cvc_check", UNSET)
|
||||||
|
|
||||||
|
payment_method_card_checks = cls(
|
||||||
|
address_line1_check=address_line1_check,
|
||||||
|
address_postal_code_check=address_postal_code_check,
|
||||||
|
cvc_check=cvc_check,
|
||||||
|
)
|
||||||
|
|
||||||
|
payment_method_card_checks.additional_properties = d
|
||||||
|
return payment_method_card_checks
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
8
kittycad/models/payment_method_type.py
Normal file
8
kittycad/models/payment_method_type.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
|
class PaymentMethodType(str, Enum):
|
||||||
|
CARD = 'card'
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return str(self.value)
|
89
kittycad/models/update_user.py
Normal file
89
kittycad/models/update_user.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||||
|
|
||||||
|
import attr
|
||||||
|
|
||||||
|
from ..types import UNSET, Unset
|
||||||
|
|
||||||
|
T = TypeVar("T", bound="UpdateUser")
|
||||||
|
|
||||||
|
|
||||||
|
@attr.s(auto_attribs=True)
|
||||||
|
class UpdateUser:
|
||||||
|
""" """
|
||||||
|
company: Union[Unset, str] = UNSET
|
||||||
|
discord: Union[Unset, str] = UNSET
|
||||||
|
first_name: Union[Unset, str] = UNSET
|
||||||
|
github: Union[Unset, str] = UNSET
|
||||||
|
last_name: Union[Unset, str] = UNSET
|
||||||
|
phone: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
|
company = self.company
|
||||||
|
discord = self.discord
|
||||||
|
first_name = self.first_name
|
||||||
|
github = self.github
|
||||||
|
last_name = self.last_name
|
||||||
|
phone = self.phone
|
||||||
|
|
||||||
|
field_dict: Dict[str, Any] = {}
|
||||||
|
field_dict.update(self.additional_properties)
|
||||||
|
field_dict.update({})
|
||||||
|
if company is not UNSET:
|
||||||
|
field_dict['company'] = company
|
||||||
|
if discord is not UNSET:
|
||||||
|
field_dict['discord'] = discord
|
||||||
|
if first_name is not UNSET:
|
||||||
|
field_dict['first_name'] = first_name
|
||||||
|
if github is not UNSET:
|
||||||
|
field_dict['github'] = github
|
||||||
|
if last_name is not UNSET:
|
||||||
|
field_dict['last_name'] = last_name
|
||||||
|
if phone is not UNSET:
|
||||||
|
field_dict['phone'] = phone
|
||||||
|
|
||||||
|
return field_dict
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
|
d = src_dict.copy()
|
||||||
|
company = d.pop("company", UNSET)
|
||||||
|
|
||||||
|
discord = d.pop("discord", UNSET)
|
||||||
|
|
||||||
|
first_name = d.pop("first_name", UNSET)
|
||||||
|
|
||||||
|
github = d.pop("github", UNSET)
|
||||||
|
|
||||||
|
last_name = d.pop("last_name", UNSET)
|
||||||
|
|
||||||
|
phone = d.pop("phone", UNSET)
|
||||||
|
|
||||||
|
update_user = cls(
|
||||||
|
company=company,
|
||||||
|
discord=discord,
|
||||||
|
first_name=first_name,
|
||||||
|
github=github,
|
||||||
|
last_name=last_name,
|
||||||
|
phone=phone,
|
||||||
|
)
|
||||||
|
|
||||||
|
update_user.additional_properties = d
|
||||||
|
return update_user
|
||||||
|
|
||||||
|
@property
|
||||||
|
def additional_keys(self) -> List[str]:
|
||||||
|
return list(self.additional_properties.keys())
|
||||||
|
|
||||||
|
def __getitem__(self, key: str) -> Any:
|
||||||
|
return self.additional_properties[key]
|
||||||
|
|
||||||
|
def __setitem__(self, key: str, value: Any) -> None:
|
||||||
|
self.additional_properties[key] = value
|
||||||
|
|
||||||
|
def __delitem__(self, key: str) -> None:
|
||||||
|
del self.additional_properties[key]
|
||||||
|
|
||||||
|
def __contains__(self, key: str) -> bool:
|
||||||
|
return key in self.additional_properties
|
@ -10,14 +10,14 @@ T = TypeVar("T", bound="UserResultsPage")
|
|||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
class UserResultsPage:
|
class UserResultsPage:
|
||||||
""" """
|
""" """
|
||||||
from ..models import User
|
from ..models.user import User
|
||||||
items: Union[Unset, List[User]] = UNSET
|
items: Union[Unset, List[User]] = UNSET
|
||||||
next_page: Union[Unset, str] = UNSET
|
next_page: Union[Unset, str] = UNSET
|
||||||
|
|
||||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
from ..models import User
|
from ..models.user import User
|
||||||
items: Union[Unset, List[User]] = UNSET
|
items: Union[Unset, List[User]] = UNSET
|
||||||
if not isinstance(self.items, Unset):
|
if not isinstance(self.items, Unset):
|
||||||
items = self.items
|
items = self.items
|
||||||
@ -36,7 +36,7 @@ class UserResultsPage:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||||
d = src_dict.copy()
|
d = src_dict.copy()
|
||||||
from ..models import User
|
from ..models.user import User
|
||||||
items = cast(List[User], d.pop("items", UNSET))
|
items = cast(List[User], d.pop("items", UNSET))
|
||||||
|
|
||||||
next_page = d.pop("next_page", UNSET)
|
next_page = d.pop("next_page", UNSET)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "kittycad"
|
name = "kittycad"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
description = "A client library for accessing KittyCAD"
|
description = "A client library for accessing KittyCAD"
|
||||||
|
|
||||||
authors = []
|
authors = []
|
||||||
|
Reference in New Issue
Block a user