diff --git a/Makefile b/Makefile index dd07bca41..a7daedc8c 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,13 @@ generate: docker-image ## Generate the api client. --disable-content-trust \ -v $(CURDIR):/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 shell: docker-image ## Pop into a shell in the docker image. docker run --rm -i $(DOCKER_FLAGS) \ --name python-generator-shell \ + --disable-content-trust \ -v $(CURDIR):/usr/src \ --workdir /usr/src \ $(DOCKER_IMAGE_NAME) /bin/bash diff --git a/generate/generate.py b/generate/generate.py index c74ba7822..99e9beeba 100755 --- a/generate/generate.py +++ b/generate/generate.py @@ -82,8 +82,11 @@ def generatePaths(cwd: str, parser: dict) -> dict: paths = data['paths'] for p in paths: for method in paths[p]: - endpoint = paths[p][method] - data = generatePath(path, p, method, endpoint, data) + print('METHOD: ', method.upper()) + # Skip OPTIONS. + if method.upper() != 'OPTIONS': + endpoint = paths[p][method] + data = generatePath(path, p, method, endpoint, data) return data @@ -650,6 +653,7 @@ def generateTypes(cwd: str, parser: dict): schemas = data['components']['schemas'] for key in schemas: schema = schemas[key] + print("generating schema: ", key) generateType(path, key, schema) f.write("from ." + camel_to_snake(key) + " import " + key + "\n") @@ -658,119 +662,230 @@ def generateTypes(cwd: str, parser: dict): def generateType(path: str, name: str, schema: dict): - # Generate the type. - file_name = camel_to_snake(name) + '.py' - file_path = os.path.join(path, file_name) - type_name = schema['type'] - print("generating type: ", name, " at: ", file_path) + file_path = path + if path.endswith(".py") is False: + # Generate the type. + file_name = camel_to_snake(name) + '.py' + file_path = os.path.join(path, file_name) + + if 'type' in schema: + type_name = schema['type'] + 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 == '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): + print("generating type: ", name, " at: ", path) print(" schema: ", [schema]) - f = open(file_path, "w") - if type_name == 'object': - has_date_time = hasDateTime(schema) - if has_date_time: - f.write("import datetime\n") - f.write("from typing import Any, Dict, List, Type, TypeVar, Union, cast\n") - f.write("\n") - f.write("import attr\n") - if has_date_time: - f.write("from dateutil.parser import isoparse\n") - f.write("\n") + f = open(path, "w") - refs = getRefs(schema) - for ref in refs: - print(" ref: ", ref, "schema: ", [schema]) - f.write( - "from ..models." + - camel_to_snake(ref) + - " import " + - ref + - "\n") + 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) - f.write("from ..types import UNSET, Unset\n") - f.write("\n") - f.write("T = TypeVar(\"T\", bound=\"" + name + "\")\n") - f.write("\n") - f.write("@attr.s(auto_attribs=True)\n") - f.write("class " + name + ":\n") - # Write the description. - f.write("\t\"\"\" \"\"\"\n") - # Iterate over the properties. - for property_name in schema['properties']: - property_schema = schema['properties'][property_name] - if 'type' in property_schema: - property_type = property_schema['type'] + # Close the file. + f.close() - # Write the property. - if property_type == 'string': - if 'format' in property_schema: - if property_schema['format'] == 'date-time' or property_schema['format'] == 'partial-date-time': - f.write( - "\t" + - property_name + - ": Union[Unset, datetime.datetime] = UNSET\n") - continue - f.write( - "\t" + - property_name + - ": Union[Unset, str] = UNSET\n") - elif property_type == 'object': - if 'additionalProperties' in property_schema: - return generateType( - path, property_name, property_schema['additionalProperties']) - else: - print(" property type: ", property_type) - print(" property schema: ", property_schema) - raise Exception(" unknown type: ", property_type) - elif property_type == 'integer': - f.write( - "\t" + - property_name + - ": Union[Unset, int] = UNSET\n") - elif property_type == 'number': - f.write( - "\t" + - property_name + - ": Union[Unset, float] = UNSET\n") - elif property_type == 'boolean': - f.write( - "\t" + - property_name + - ": Union[Unset, bool] = False\n") - elif property_type == 'array': - if 'items' in property_schema: - if '$ref' in property_schema['items']: - property_type = property_schema['items']['$ref'] - property_type = property_type.replace( - '#/components/schemas/', '') - f.write( - "\tfrom ..models import " + - property_type + - "\n") - elif 'type' in property_schema['items']: - if property_schema['items']['type'] == 'string': - property_type = 'str' - else: - print(" property: ", property_schema) - raise Exception("Unknown property type") - else: - print(" array: ", [property_schema]) - print(" array: ", [property_schema['items']]) - raise Exception("Unknown array type") +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 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) + if has_date_time: + f.write("import datetime\n") + f.write("from typing import Any, Dict, List, Type, TypeVar, Union, cast\n") + f.write("\n") + f.write("import attr\n") + if has_date_time: + f.write("from dateutil.parser import isoparse\n") + f.write("\n") + + refs = getRefs(schema) + for ref in refs: + print(" ref: ", ref, "schema: ", [schema]) + f.write( + "from ..models." + + camel_to_snake(ref) + + " import " + + ref + + "\n") + + f.write("from ..types import UNSET, Unset\n") + f.write("\n") + f.write("T = TypeVar(\"T\", bound=\"" + name + "\")\n") + f.write("\n") + f.write("@attr.s(auto_attribs=True)\n") + f.write("class " + name + ":\n") + # Write the description. + f.write("\t\"\"\" \"\"\"\n") + # Iterate over the properties. + for property_name in schema['properties']: + property_schema = schema['properties'][property_name] + if 'type' in property_schema: + property_type = property_schema['type'] + + # Write the property. + if property_type == 'string': + if 'format' in property_schema: + if property_schema['format'] == 'date-time' or property_schema['format'] == 'partial-date-time': f.write( "\t" + property_name + - ": Union[Unset, List[" + - property_type + - "]] = UNSET\n") - else: - raise Exception("Unknown array type") + ": Union[Unset, datetime.datetime] = UNSET\n") + continue + + f.write( + "\t" + + property_name + + ": Union[Unset, str] = UNSET\n") + elif property_type == 'object': + if 'additionalProperties' in property_schema: + return generateType( + path, property_name, property_schema['additionalProperties']) else: print(" property type: ", property_type) + print(" property schema: ", property_schema) raise Exception(" unknown type: ", property_type) - elif '$ref' in property_schema: - ref = property_schema['$ref'].replace( + elif property_type == 'integer': + f.write( + "\t" + + property_name + + ": Union[Unset, int] = UNSET\n") + elif property_type == 'number': + f.write( + "\t" + + property_name + + ": Union[Unset, float] = UNSET\n") + elif property_type == 'boolean': + f.write( + "\t" + + property_name + + ": Union[Unset, bool] = False\n") + elif property_type == 'array': + if 'items' in property_schema: + if '$ref' in property_schema['items']: + property_type = property_schema['items']['$ref'] + property_type = property_type.replace( + '#/components/schemas/', '') + f.write( + "\tfrom ..models import " + + property_type + + "\n") + elif 'type' in property_schema['items']: + if property_schema['items']['type'] == 'string': + property_type = 'str' + else: + print(" property: ", property_schema) + raise Exception("Unknown property type") + else: + print(" array: ", [property_schema]) + print(" array: ", [property_schema['items']]) + raise Exception("Unknown array type") + + f.write( + "\t" + + property_name + + ": Union[Unset, List[" + + property_type + + "]] = UNSET\n") + else: + raise Exception("Unknown array type") + else: + print(" property type: ", property_type) + raise Exception(" unknown type: ", property_type) + elif '$ref' in property_schema: + ref = property_schema['$ref'].replace( + '#/components/schemas/', '') + f.write( + "\t" + + property_name + + ": Union[Unset, " + + ref + + "] = UNSET\n") + elif 'allOf' in property_schema: + thing = property_schema['allOf'][0] + if '$ref' in thing: + ref = thing['$ref'].replace( '#/components/schemas/', '') f.write( "\t" + @@ -778,122 +893,130 @@ def generateType(path: str, name: str, schema: dict): ": Union[Unset, " + ref + "] = UNSET\n") - elif 'allOf' in property_schema: - thing = property_schema['allOf'][0] - if '$ref' in thing: - ref = thing['$ref'].replace( - '#/components/schemas/', '') - f.write( - "\t" + - property_name + - ": Union[Unset, " + - ref + - "] = UNSET\n") - else: - raise Exception(" unknown allOf type: ", property_schema) else: - raise Exception(" unknown schema: ", property_schema) + raise Exception(" unknown allOf type: ", property_schema) + else: + raise Exception(" unknown schema: ", property_schema) - # Finish writing the class. - f.write("\n") - f.write( - "\tadditional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)\n") + # Finish writing the class. + f.write("\n") + f.write( + "\tadditional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)\n") - # Now let's write the to_dict method. - f.write("\n") - f.write("\tdef to_dict(self) -> Dict[str, Any]:\n") - # Iternate over the properties. - for property_name in schema['properties']: - property_schema = schema['properties'][property_name] - if 'type' in property_schema: - property_type = property_schema['type'] + # Now let's write the to_dict method. + f.write("\n") + f.write("\tdef to_dict(self) -> Dict[str, Any]:\n") + # Iternate over the properties. + for property_name in schema['properties']: + property_schema = schema['properties'][property_name] + if 'type' in property_schema: + property_type = property_schema['type'] - # Write the property. - if property_type == 'string': - if 'format' in property_schema: - if property_schema['format'] == 'date-time' or property_schema['format'] == 'partial-date-time': - f.write( - "\t\t" + - property_name + - ": Union[Unset, str] = UNSET\n") - f.write( - "\t\tif not isinstance(self." + property_name + ", Unset):\n") - f.write( - "\t\t\t" + - property_name + - " = self." + - property_name + - ".isoformat()\n") - continue + # Write the property. + if property_type == 'string': + if 'format' in property_schema: + if property_schema['format'] == 'date-time' or property_schema['format'] == 'partial-date-time': + f.write( + "\t\t" + + property_name + + ": Union[Unset, str] = UNSET\n") + f.write( + "\t\tif not isinstance(self." + property_name + ", Unset):\n") + f.write( + "\t\t\t" + + property_name + + " = self." + + property_name + + ".isoformat()\n") + continue - f.write( - "\t\t" + - property_name + - " = self." + - property_name + - "\n") - elif property_type == 'integer': - f.write( - "\t\t" + - property_name + - " = self." + - property_name + - "\n") - elif property_type == 'number': - f.write( - "\t\t" + - property_name + - " = self." + - property_name + - "\n") - elif property_type == 'boolean': - f.write( - "\t\t" + - property_name + - " = self." + - property_name + - "\n") - elif property_type == 'array': - if 'items' in property_schema: - if '$ref' in property_schema['items']: - property_type = property_schema['items']['$ref'] - property_type = property_type.replace( - '#/components/schemas/', '') - f.write( - "\t\tfrom ..models import " + - property_type + - "\n") - elif 'type' in property_schema['items']: - if property_schema['items']['type'] == 'string': - property_type = 'str' - else: - print(" property: ", property_schema) - raise Exception("Unknown property type") + f.write( + "\t\t" + + property_name + + " = self." + + property_name + + "\n") + elif property_type == 'integer': + f.write( + "\t\t" + + property_name + + " = self." + + property_name + + "\n") + elif property_type == 'number': + f.write( + "\t\t" + + property_name + + " = self." + + property_name + + "\n") + elif property_type == 'boolean': + f.write( + "\t\t" + + property_name + + " = self." + + property_name + + "\n") + elif property_type == 'array': + if 'items' in property_schema: + if '$ref' in property_schema['items']: + property_type = property_schema['items']['$ref'] + property_type = property_type.replace( + '#/components/schemas/', '') + f.write( + "\t\tfrom ..models import " + + property_type + + "\n") + elif 'type' in property_schema['items']: + if property_schema['items']['type'] == 'string': + property_type = 'str' else: - print(" array: ", [property_schema]) - print(" array: ", [property_schema['items']]) - raise Exception("Unknown array type") + print(" property: ", property_schema) + raise Exception("Unknown property type") + else: + print(" array: ", [property_schema]) + print(" array: ", [property_schema['items']]) + raise Exception("Unknown array type") - f.write( - "\t\t" + - property_name + - ": Union[Unset, List[" + - property_type + - "]] = UNSET\n") - f.write( - "\t\tif not isinstance(self." + - property_name + - ", Unset):\n") - f.write( - "\t\t\t" + - property_name + - " = self." + - property_name + - "\n") - else: - raise Exception(" unknown type: ", property_type) - elif '$ref' in property_schema: - ref = property_schema['$ref'].replace( + f.write( + "\t\t" + + property_name + + ": Union[Unset, List[" + + property_type + + "]] = UNSET\n") + f.write( + "\t\tif not isinstance(self." + + property_name + + ", Unset):\n") + f.write( + "\t\t\t" + + property_name + + " = self." + + property_name + + "\n") + else: + raise Exception(" unknown type: ", property_type) + elif '$ref' in property_schema: + ref = property_schema['$ref'].replace( + '#/components/schemas/', '') + f.write( + "\t\t" + + property_name + + ": Union[Unset, str] = UNSET\n") + f.write( + "\t\tif not isinstance(self." + + property_name + + ", Unset):\n") + f.write( + "\t\t\t" + + property_name + + " = self." + + property_name + + ".value\n") + elif 'allOf' in property_schema: + thing = property_schema['allOf'][0] + if '$ref' in thing: + ref = thing['$ref'].replace( '#/components/schemas/', '') f.write( "\t\t" + @@ -909,151 +1032,154 @@ def generateType(path: str, name: str, schema: dict): " = self." + property_name + ".value\n") - elif 'allOf' in property_schema: - thing = property_schema['allOf'][0] - if '$ref' in thing: - ref = thing['$ref'].replace( - '#/components/schemas/', '') - f.write( - "\t\t" + - property_name + - ": Union[Unset, str] = UNSET\n") - f.write( - "\t\tif not isinstance(self." + - property_name + - ", Unset):\n") - f.write( - "\t\t\t" + - property_name + - " = self." + - property_name + - ".value\n") - else: - raise Exception(" unknown allOf type: ", property_schema) else: - raise Exception(" unknown schema: ", property_schema) + raise Exception(" unknown allOf type: ", property_schema) + else: + raise Exception(" unknown schema: ", property_schema) - # Finish writing the to_dict method. - f.write("\n") - f.write("\t\tfield_dict: Dict[str, Any] = {}\n") - f.write("\t\tfield_dict.update(self.additional_properties)\n") - f.write("\t\tfield_dict.update({})\n") + # Finish writing the to_dict method. + f.write("\n") + f.write("\t\tfield_dict: Dict[str, Any] = {}\n") + f.write("\t\tfield_dict.update(self.additional_properties)\n") + f.write("\t\tfield_dict.update({})\n") - # Iternate over the properties. - for property_name in schema['properties']: - # Write the property. - f.write("\t\tif " + property_name + " is not UNSET:\n") - f.write( - "\t\t\tfield_dict['" + - property_name + - "'] = " + - property_name + - "\n") - - f.write("\n") - f.write("\t\treturn field_dict\n") - - # Now let's write the from_dict method. - f.write("\n") - f.write("\t@classmethod\n") + # Iternate over the properties. + for property_name in schema['properties']: + # Write the property. + f.write("\t\tif " + property_name + " is not UNSET:\n") f.write( - "\tdef from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:\n") - f.write("\t\td = src_dict.copy()\n") + "\t\t\tfield_dict['" + + property_name + + "'] = " + + property_name + + "\n") - # Iternate over the properties. - for property_name in schema['properties']: - property_schema = schema['properties'][property_name] - if 'type' in property_schema: - property_type = property_schema['type'] + f.write("\n") + f.write("\t\treturn field_dict\n") - # Write the property. - if property_type == 'string': - if 'format' in property_schema: - if property_schema['format'] == 'date-time' or property_schema['format'] == 'partial-date-time': - f.write( - "\t\t_" + - property_name + - " = d.pop(\"" + - property_name + - "\", UNSET)\n") - f.write( - "\t\t" + - property_name + - ": Union[Unset, datetime.datetime]\n") - f.write( - "\t\tif isinstance(_" + property_name + ", Unset):\n") - f.write("\t\t\t" + property_name + " = UNSET\n") - f.write("\t\telse:\n") - f.write("\t\t\t" + property_name + - " = isoparse(_" + property_name + ")\n") - f.write("\n") - continue + # Now let's write the from_dict method. + f.write("\n") + f.write("\t@classmethod\n") + f.write( + "\tdef from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:\n") + f.write("\t\td = src_dict.copy()\n") - f.write( - "\t\t" + - property_name + - " = d.pop(\"" + - property_name + - "\", UNSET)\n") - f.write("\n") - elif property_type == 'integer': - f.write( - "\t\t" + - property_name + - " = d.pop(\"" + - property_name + - "\", UNSET)\n") - f.write("\n") - elif property_type == 'number': - f.write( - "\t\t" + - property_name + - " = d.pop(\"" + - property_name + - "\", UNSET)\n") - f.write("\n") - elif property_type == 'boolean': - f.write( - "\t\t" + - property_name + - " = d.pop(\"" + - property_name + - "\", UNSET)\n") - f.write("\n") - elif property_type == 'array': - if 'items' in property_schema: - if '$ref' in property_schema['items']: - property_type = property_schema['items']['$ref'] - property_type = property_type.replace( - '#/components/schemas/', '') - f.write( - "\t\tfrom ..models import " + - property_type + - "\n") - elif 'type' in property_schema['items']: - if property_schema['items']['type'] == 'string': - property_type = 'str' - else: - raise Exception( - " unknown array type: ", - property_schema['items']['type']) + # Iternate over the properties. + for property_name in schema['properties']: + property_schema = schema['properties'][property_name] + if 'type' in property_schema: + property_type = property_schema['type'] + + # Write the property. + if property_type == 'string': + if 'format' in property_schema: + if property_schema['format'] == 'date-time' or property_schema['format'] == 'partial-date-time': + f.write( + "\t\t_" + + property_name + + " = d.pop(\"" + + property_name + + "\", UNSET)\n") + f.write( + "\t\t" + + property_name + + ": Union[Unset, datetime.datetime]\n") + f.write( + "\t\tif isinstance(_" + property_name + ", Unset):\n") + f.write("\t\t\t" + property_name + " = UNSET\n") + f.write("\t\telse:\n") + f.write("\t\t\t" + property_name + + " = isoparse(_" + property_name + ")\n") + f.write("\n") + continue + + f.write( + "\t\t" + + property_name + + " = d.pop(\"" + + property_name + + "\", UNSET)\n") + f.write("\n") + elif property_type == 'integer': + f.write( + "\t\t" + + property_name + + " = d.pop(\"" + + property_name + + "\", UNSET)\n") + f.write("\n") + elif property_type == 'number': + f.write( + "\t\t" + + property_name + + " = d.pop(\"" + + property_name + + "\", UNSET)\n") + f.write("\n") + elif property_type == 'boolean': + f.write( + "\t\t" + + property_name + + " = d.pop(\"" + + property_name + + "\", UNSET)\n") + f.write("\n") + elif property_type == 'array': + if 'items' in property_schema: + if '$ref' in property_schema['items']: + property_type = property_schema['items']['$ref'] + property_type = property_type.replace( + '#/components/schemas/', '') + f.write( + "\t\tfrom ..models import " + + property_type + + "\n") + elif 'type' in property_schema['items']: + if property_schema['items']['type'] == 'string': + property_type = 'str' else: - print(" array: ", [property_schema]) - print(" array: ", [property_schema['items']]) - raise Exception("Unknown array type") + raise Exception( + " unknown array type: ", + property_schema['items']['type']) + else: + print(" array: ", [property_schema]) + print(" array: ", [property_schema['items']]) + raise Exception("Unknown array type") - f.write( - "\t\t" + - property_name + - " = cast(List[" + property_type + "], d.pop(\"" + - property_name + - "\", UNSET))\n") - f.write("\n") - else: - print(" unknown type: ", property_type) - raise Exception(" unknown type: ", property_type) - elif '$ref' in property_schema: - ref = property_schema['$ref'].replace( + f.write( + "\t\t" + + property_name + + " = cast(List[" + property_type + "], d.pop(\"" + + property_name + + "\", UNSET))\n") + f.write("\n") + else: + print(" unknown type: ", property_type) + raise Exception(" unknown type: ", property_type) + elif '$ref' in property_schema: + ref = property_schema['$ref'].replace( + '#/components/schemas/', '') + f.write( + "\t\t_" + + property_name + + " = d.pop(\"" + + property_name + + "\", UNSET)\n") + f.write("\t\t" + property_name + + ": Union[Unset, " + ref + "]\n") + f.write( + "\t\tif isinstance(_" + + property_name + + ", Unset):\n") + f.write("\t\t\t" + property_name + " = UNSET\n") + f.write("\t\telse:\n") + f.write("\t\t\t" + property_name + " = " + + ref + "(_" + property_name + ")\n") + f.write("\n") + elif 'allOf' in property_schema: + thing = property_schema['allOf'][0] + if '$ref' in thing: + ref = thing['$ref'].replace( '#/components/schemas/', '') f.write( "\t\t_" + @@ -1072,99 +1198,47 @@ def generateType(path: str, name: str, schema: dict): f.write("\t\t\t" + property_name + " = " + ref + "(_" + property_name + ")\n") f.write("\n") - elif 'allOf' in property_schema: - thing = property_schema['allOf'][0] - if '$ref' in thing: - ref = thing['$ref'].replace( - '#/components/schemas/', '') - f.write( - "\t\t_" + - property_name + - " = d.pop(\"" + - property_name + - "\", UNSET)\n") - f.write("\t\t" + property_name + - ": Union[Unset, " + ref + "]\n") - f.write( - "\t\tif isinstance(_" + - property_name + - ", Unset):\n") - f.write("\t\t\t" + property_name + " = UNSET\n") - f.write("\t\telse:\n") - f.write("\t\t\t" + property_name + " = " + - ref + "(_" + property_name + ")\n") - f.write("\n") - else: - raise Exception(" unknown allOf type: ", property_schema) else: - print(" unknown schema: ", property_schema) - raise Exception(" unknown schema: ", property_schema) + raise Exception(" unknown allOf type: ", property_schema) + else: + print(" unknown schema: ", property_schema) + raise Exception(" unknown schema: ", property_schema) - # Finish writing the from_dict method. - f.write("\n") - f.write("\t\t" + camel_to_snake(name) + " = cls(\n") - # Iternate over the properties. - for property_name in schema['properties']: - # Write the property. - f.write("\t\t\t" + property_name + "= " + property_name + ",\n") + # Finish writing the from_dict method. + f.write("\n") + f.write("\t\t" + camel_to_snake(name) + " = cls(\n") + # Iternate over the properties. + for property_name in schema['properties']: + # Write the property. + f.write("\t\t\t" + property_name + "= " + property_name + ",\n") - # Close the class. - f.write("\t\t)\n") - f.write("\n") - f.write("\t\t" + camel_to_snake(name) + ".additional_properties = d\n") - f.write("\t\treturn " + camel_to_snake(name) + "\n") + # Close the class. + f.write("\t\t)\n") + f.write("\n") + f.write("\t\t" + camel_to_snake(name) + ".additional_properties = d\n") + f.write("\t\treturn " + camel_to_snake(name) + "\n") - # write the rest of the class. - f.write("\n") - f.write("\t@property\n") - f.write("\tdef additional_keys(self) -> List[str]:\n") - f.write("\t\treturn list(self.additional_properties.keys())\n") + # write the rest of the class. + f.write("\n") + f.write("\t@property\n") + f.write("\tdef additional_keys(self) -> List[str]:\n") + f.write("\t\treturn list(self.additional_properties.keys())\n") - f.write("\n") - f.write("\tdef __getitem__(self, key: str) -> Any:\n") - f.write("\t\treturn self.additional_properties[key]\n") + f.write("\n") + f.write("\tdef __getitem__(self, key: str) -> Any:\n") + f.write("\t\treturn self.additional_properties[key]\n") - f.write("\n") - f.write("\tdef __setitem__(self, key: str, value: Any) -> None:\n") - f.write("\t\tself.additional_properties[key] = value\n") + f.write("\n") + f.write("\tdef __setitem__(self, key: str, value: Any) -> None:\n") + f.write("\t\tself.additional_properties[key] = value\n") - f.write("\n") - f.write("\tdef __delitem__(self, key: str) -> None:\n") - f.write("\t\tdel self.additional_properties[key]\n") + f.write("\n") + f.write("\tdef __delitem__(self, key: str) -> None:\n") + f.write("\t\tdel self.additional_properties[key]\n") - f.write("\n") - f.write("\tdef __contains__(self, key: str) -> bool:\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) + f.write("\n") + f.write("\tdef __contains__(self, key: str) -> bool:\n") + f.write("\t\treturn key in self.additional_properties\n") # Close the file. f.close() @@ -1176,11 +1250,12 @@ def hasDateTime(schema: dict) -> bool: type_name = schema['type'] if type_name == 'object': # Iternate over the properties. - for property_name in schema['properties']: - property_schema = schema['properties'][property_name] - has_date_time = hasDateTime(property_schema) - if has_date_time: - return True + if 'properties' in schema: + for property_name in schema['properties']: + property_schema = schema['properties'][property_name] + has_date_time = hasDateTime(property_schema) + if has_date_time: + return True elif type_name == 'string' and 'format' in schema: if schema['format'] == 'date-time' or schema['format'] == 'partial-date-time': return True diff --git a/generate/run.sh b/generate/run.sh new file mode 100755 index 000000000..644fadd8f --- /dev/null +++ b/generate/run.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +set -o pipefail + +# Cleanup old stuff. +rm -rf kittycad/models +rm -rf kittycad/api + +# 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 diff --git a/kittycad/api/api-calls/get_async_operation.py b/kittycad/api/api-calls/get_async_operation.py new file mode 100644 index 000000000..bebd52825 --- /dev/null +++ b/kittycad/api/api-calls/get_async_operation.py @@ -0,0 +1,115 @@ +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ...client import Client +from ...models.async_api_call_output import AsyncApiCallOutput +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, AsyncApiCallOutput, Error]]: + if response.status_code == 200: + response_200 = AsyncApiCallOutput.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, AsyncApiCallOutput, 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, AsyncApiCallOutput, 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, AsyncApiCallOutput, 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, AsyncApiCallOutput, 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, AsyncApiCallOutput, 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 diff --git a/kittycad/api/beta/__init__.py b/kittycad/api/beta/__init__.py new file mode 100644 index 000000000..56e818a72 --- /dev/null +++ b/kittycad/api/beta/__init__.py @@ -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. """ diff --git a/kittycad/api/file/create_file_conversion.py b/kittycad/api/file/create_file_conversion.py index f701f0b73..c844d7f29 100644 --- a/kittycad/api/file/create_file_conversion.py +++ b/kittycad/api/file/create_file_conversion.py @@ -3,15 +3,15 @@ from typing import Any, Dict, Optional, Union, cast import httpx 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.file_conversion_output_format import FileConversionOutputFormat -from ...models.file_conversion_source_format import FileConversionSourceFormat +from ...models.file_output_format import FileOutputFormat +from ...models.file_source_format import FileSourceFormat from ...types import Response def _get_kwargs( - output_format: FileConversionOutputFormat, - src_format: FileConversionSourceFormat, + output_format: FileOutputFormat, + src_format: FileSourceFormat, body: bytes, *, 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: - response_201 = FileConversionWithOutput.from_dict(response.json()) + response_201 = FileConversion.from_dict(response.json()) return response_201 if response.status_code == 400: response_4XX = Error.from_dict(response.json()) @@ -43,7 +43,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv 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( status_code=response.status_code, content=response.content, @@ -53,12 +53,12 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConv def sync_detailed( - output_format: FileConversionOutputFormat, - src_format: FileConversionSourceFormat, + output_format: FileOutputFormat, + src_format: FileSourceFormat, body: bytes, *, client: Client, -) -> Response[Union[Any, FileConversionWithOutput, Error]]: +) -> Response[Union[Any, FileConversion, Error]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -75,15 +75,15 @@ def sync_detailed( def sync( - output_format: FileConversionOutputFormat, - src_format: FileConversionSourceFormat, + output_format: FileOutputFormat, + src_format: FileSourceFormat, body: bytes, *, 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. 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( 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( - output_format: FileConversionOutputFormat, - src_format: FileConversionSourceFormat, + output_format: FileOutputFormat, + src_format: FileSourceFormat, body: bytes, *, client: Client, -) -> Response[Union[Any, FileConversionWithOutput, Error]]: +) -> Response[Union[Any, FileConversion, Error]]: kwargs = _get_kwargs( output_format=output_format, src_format=src_format, @@ -114,15 +114,15 @@ async def asyncio_detailed( async def asyncio( - output_format: FileConversionOutputFormat, - src_format: FileConversionSourceFormat, + output_format: FileOutputFormat, + src_format: FileSourceFormat, body: bytes, *, 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. 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 ( await asyncio_detailed( diff --git a/kittycad/api/file/create_file_conversion_with_base64_helper.py b/kittycad/api/file/create_file_conversion_with_base64_helper.py deleted file mode 100644 index f04fac064..000000000 --- a/kittycad/api/file/create_file_conversion_with_base64_helper.py +++ /dev/null @@ -1,59 +0,0 @@ -from typing import Any, Dict, Optional, Union - -import base64 -import httpx - -from ...client import Client -from ...models import Error -from ...models import FileConversionWithOutput -from ...models import FileConversionSourceFormat -from ...models import FileConversionOutputFormat -from ...types import Response -from ...api.file.create_file_conversion import sync as fc_sync, asyncio as fc_asyncio - -def sync( - src_format: FileConversionSourceFormat, - output_format: FileConversionOutputFormat, - body: bytes, - *, - client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, 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.""" - - encoded = base64.b64encode(body) - - fc = fc_sync( - src_format=src_format, - output_format=output_format, - body=encoded, - client=client, - ) - - if isinstance(fc, FileConversionWithOutput) and fc.output != "": - fc.output = base64.b64decode(fc.output) - - return fc - - -async def asyncio( - src_format: FileConversionSourceFormat, - output_format: FileConversionOutputFormat, - body: bytes, - *, - client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, 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.""" - - encoded = base64.b64encode(body) - - fc = await fc_asyncio( - src_format=src_format, - output_format=output_format, - body=encoded, - client=client, - ) - - if isinstance(fc, FileConversionWithOutput) and fc.output != "": - fc.output = base64.b64decode(fc.output) - - return fc diff --git a/kittycad/api/file/create_file_execution.py b/kittycad/api/file/create_file_execution.py new file mode 100644 index 000000000..69abc1c9a --- /dev/null +++ b/kittycad/api/file/create_file_execution.py @@ -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 diff --git a/kittycad/api/file/create_file_mass.py b/kittycad/api/file/create_file_mass.py new file mode 100644 index 000000000..e0cc445c3 --- /dev/null +++ b/kittycad/api/file/create_file_mass.py @@ -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: number, + 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: number, + 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: number, + 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: number, + 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: number, + 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 diff --git a/kittycad/api/file/create_file_volume.py b/kittycad/api/file/create_file_volume.py new file mode 100644 index 000000000..80569121d --- /dev/null +++ b/kittycad/api/file/create_file_volume.py @@ -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 diff --git a/kittycad/api/file/get_file_conversion.py b/kittycad/api/file/get_file_conversion.py index 9ae6226c2..f47c932cc 100644 --- a/kittycad/api/file/get_file_conversion.py +++ b/kittycad/api/file/get_file_conversion.py @@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Union, cast import httpx from ...client import Client -from ...models.file_conversion_with_output import FileConversionWithOutput +from ...models.async_api_call_output import AsyncApiCallOutput from ...models.error import Error from ...types import Response @@ -25,9 +25,9 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionWithOutput, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, AsyncApiCallOutput, Error]]: if response.status_code == 200: - response_200 = FileConversionWithOutput.from_dict(response.json()) + response_200 = AsyncApiCallOutput.from_dict(response.json()) return response_200 if response.status_code == 400: response_4XX = Error.from_dict(response.json()) @@ -38,7 +38,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv return None -def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionWithOutput, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Union[Any, AsyncApiCallOutput, Error]]: return Response( status_code=response.status_code, content=response.content, @@ -51,7 +51,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, FileConversionWithOutput, Error]]: +) -> Response[Union[Any, AsyncApiCallOutput, Error]]: kwargs = _get_kwargs( id=id, client=client, @@ -69,7 +69,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, Error]]: +) -> Optional[Union[Any, AsyncApiCallOutput, Error]]: """ 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. If the user is not authenticated to view the specified file conversion, then it is not returned. @@ -85,7 +85,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, FileConversionWithOutput, Error]]: +) -> Response[Union[Any, AsyncApiCallOutput, Error]]: kwargs = _get_kwargs( id=id, client=client, @@ -101,7 +101,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, Error]]: +) -> Optional[Union[Any, AsyncApiCallOutput, Error]]: """ 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. If the user is not authenticated to view the specified file conversion, then it is not returned. diff --git a/kittycad/api/file/get_file_conversion_for_user.py b/kittycad/api/file/get_file_conversion_for_user.py index 38dd762b6..77a6826e6 100644 --- a/kittycad/api/file/get_file_conversion_for_user.py +++ b/kittycad/api/file/get_file_conversion_for_user.py @@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Union, cast import httpx from ...client import Client -from ...models.file_conversion_with_output import FileConversionWithOutput +from ...models.async_api_call_output import AsyncApiCallOutput from ...models.error import Error from ...types import Response @@ -25,9 +25,9 @@ def _get_kwargs( } -def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionWithOutput, Error]]: +def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, AsyncApiCallOutput, Error]]: if response.status_code == 200: - response_200 = FileConversionWithOutput.from_dict(response.json()) + response_200 = AsyncApiCallOutput.from_dict(response.json()) return response_200 if response.status_code == 400: response_4XX = Error.from_dict(response.json()) @@ -38,7 +38,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv return None -def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversionWithOutput, Error]]: +def _build_response(*, response: httpx.Response) -> Response[Union[Any, AsyncApiCallOutput, Error]]: return Response( status_code=response.status_code, content=response.content, @@ -51,7 +51,7 @@ def sync_detailed( id: str, *, client: Client, -) -> Response[Union[Any, FileConversionWithOutput, Error]]: +) -> Response[Union[Any, AsyncApiCallOutput, Error]]: kwargs = _get_kwargs( id=id, client=client, @@ -69,7 +69,7 @@ def sync( id: str, *, client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, Error]]: +) -> Optional[Union[Any, AsyncApiCallOutput, 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. This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """ @@ -83,7 +83,7 @@ async def asyncio_detailed( id: str, *, client: Client, -) -> Response[Union[Any, FileConversionWithOutput, Error]]: +) -> Response[Union[Any, AsyncApiCallOutput, Error]]: kwargs = _get_kwargs( id=id, client=client, @@ -99,7 +99,7 @@ async def asyncio( id: str, *, client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, Error]]: +) -> Optional[Union[Any, AsyncApiCallOutput, 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. This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """ diff --git a/kittycad/api/file/get_file_conversion_with_base64_helper.py b/kittycad/api/file/get_file_conversion_with_base64_helper.py deleted file mode 100644 index 2e295990c..000000000 --- a/kittycad/api/file/get_file_conversion_with_base64_helper.py +++ /dev/null @@ -1,46 +0,0 @@ -from typing import Any, Dict, Optional, Union - -import base64 -import httpx - -from ...client import Client -from ...models import Error -from ...models.file_conversion import FileConversionWithOutput -from ...types import Response -from ...api.file.get_file_conversion import sync as fc_sync, asyncio as fc_asyncio - - -def sync( - id: str, - *, - client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, Error]]: - """Get the status of a file conversion. This function automatically base64 decodes the output response if there is one.""" - - fc = fc_sync( - id=id, - client=client, - ) - - if isinstance(fc, FileConversionWithOutput) and fc.output != "": - fc.output = base64.b64decode(fc.output) - - return fc - - -async def asyncio( - id: str, - *, - client: Client, -) -> Optional[Union[Any, FileConversionWithOutput, Error]]: - """Get the status of a file conversion. This function automatically base64 decodes the output response if there is one.""" - - fc = await fc_asyncio( - id=id, - client=client, - ) - - if isinstance(fc, FileConversionWithOutput) and fc.output != "": - fc.output = base64.b64decode(fc.output) - - return fc diff --git a/kittycad/api/file/list_file_conversions.py b/kittycad/api/file/list_file_conversions.py deleted file mode 100644 index 78c5d323f..000000000 --- a/kittycad/api/file/list_file_conversions.py +++ /dev/null @@ -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 diff --git a/kittycad/api/file/list_file_conversions_for_user.py b/kittycad/api/file/list_file_conversions_for_user.py deleted file mode 100644 index b944e74fe..000000000 --- a/kittycad/api/file/list_file_conversions_for_user.py +++ /dev/null @@ -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 diff --git a/kittycad/api/hidden/__init__.py b/kittycad/api/hidden/__init__.py new file mode 100644 index 000000000..bf427f8aa --- /dev/null +++ b/kittycad/api/hidden/__init__.py @@ -0,0 +1 @@ +""" Contains methods for accessing the hidden API paths: Hidden API endpoints that should not show up in the docs. """ diff --git a/kittycad/api/hidden/login.py b/kittycad/api/hidden/login.py new file mode 100644 index 000000000..5703f7543 --- /dev/null +++ b/kittycad/api/hidden/login.py @@ -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 diff --git a/kittycad/api/payments/__init__.py b/kittycad/api/payments/__init__.py new file mode 100644 index 000000000..ce7785282 --- /dev/null +++ b/kittycad/api/payments/__init__.py @@ -0,0 +1 @@ +""" Contains methods for accessing the payments API paths: Operations around payments and billing. """ diff --git a/kittycad/api/payments/create_payment_information_for_user.py b/kittycad/api/payments/create_payment_information_for_user.py new file mode 100644 index 000000000..d359aaa8c --- /dev/null +++ b/kittycad/api/payments/create_payment_information_for_user.py @@ -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 diff --git a/kittycad/api/payments/create_payment_intent_for_user.py b/kittycad/api/payments/create_payment_intent_for_user.py new file mode 100644 index 000000000..f96145f61 --- /dev/null +++ b/kittycad/api/payments/create_payment_intent_for_user.py @@ -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 diff --git a/kittycad/api/payments/delete_payment_information_for_user.py b/kittycad/api/payments/delete_payment_information_for_user.py new file mode 100644 index 000000000..0849692b1 --- /dev/null +++ b/kittycad/api/payments/delete_payment_information_for_user.py @@ -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 diff --git a/kittycad/api/payments/delete_payment_method_for_user.py b/kittycad/api/payments/delete_payment_method_for_user.py new file mode 100644 index 000000000..e0e8048a6 --- /dev/null +++ b/kittycad/api/payments/delete_payment_method_for_user.py @@ -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 diff --git a/kittycad/api/payments/get_payment_information_for_user.py b/kittycad/api/payments/get_payment_information_for_user.py new file mode 100644 index 000000000..0159bca43 --- /dev/null +++ b/kittycad/api/payments/get_payment_information_for_user.py @@ -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 diff --git a/kittycad/api/payments/list_invoices_for_user.py b/kittycad/api/payments/list_invoices_for_user.py new file mode 100644 index 000000000..9eb6822e7 --- /dev/null +++ b/kittycad/api/payments/list_invoices_for_user.py @@ -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 diff --git a/kittycad/api/payments/list_payment_methods_for_user.py b/kittycad/api/payments/list_payment_methods_for_user.py new file mode 100644 index 000000000..0d1526c33 --- /dev/null +++ b/kittycad/api/payments/list_payment_methods_for_user.py @@ -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 diff --git a/kittycad/api/payments/update_payment_information_for_user.py b/kittycad/api/payments/update_payment_information_for_user.py new file mode 100644 index 000000000..2fa610b7a --- /dev/null +++ b/kittycad/api/payments/update_payment_information_for_user.py @@ -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 diff --git a/kittycad/api/users/update_user_self.py b/kittycad/api/users/update_user_self.py new file mode 100644 index 000000000..90c71c22d --- /dev/null +++ b/kittycad/api/users/update_user_self.py @@ -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 diff --git a/kittycad/models/__init__.py b/kittycad/models/__init__.py index 247a729f0..b97f3079c 100644 --- a/kittycad/models/__init__.py +++ b/kittycad/models/__init__.py @@ -1,38 +1,57 @@ """ 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_by import ApiCallQueryGroupBy from .api_call_with_price import ApiCallWithPrice from .api_call_with_price_results_page import ApiCallWithPriceResultsPage from .api_token import ApiToken from .api_token_results_page import ApiTokenResultsPage +from .async_api_call_output import AsyncApiCallOutput +from .billing_info import BillingInfo +from .cache_metadata import CacheMetadata +from .card_details import CardDetails 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 .currency import Currency +from .customer import Customer from .duration import Duration from .engine_metadata import EngineMetadata +from .environment import Environment from .error import Error from .extended_user import ExtendedUser from .extended_user_results_page import ExtendedUserResultsPage from .file_conversion import FileConversion -from .file_conversion_output_format import FileConversionOutputFormat -from .file_conversion_results_page import FileConversionResultsPage -from .file_conversion_source_format import FileConversionSourceFormat -from .file_conversion_status import FileConversionStatus -from .file_conversion_with_output import FileConversionWithOutput +from .file_mass import FileMass +from .file_output_format import FileOutputFormat +from .file_source_format import FileSourceFormat from .file_system_metadata import FileSystemMetadata +from .file_volume import FileVolume 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_api_stats import JetstreamApiStats from .jetstream_config import JetstreamConfig from .jetstream_stats import JetstreamStats from .leaf_node import LeafNode +from .login_params import LoginParams from .meta_cluster_info import MetaClusterInfo from .metadata import Metadata 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 .session import Session from .status_code import StatusCode +from .update_user import UpdateUser from .user import User from .user_results_page import UserResultsPage from .uuid import Uuid diff --git a/kittycad/models/address.py b/kittycad/models/address.py new file mode 100644 index 000000000..4b59a753e --- /dev/null +++ b/kittycad/models/address.py @@ -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 diff --git a/kittycad/models/file_conversion_status.py b/kittycad/models/api_call_status.py similarity index 84% rename from kittycad/models/file_conversion_status.py rename to kittycad/models/api_call_status.py index 49fa5419f..7d56584ec 100644 --- a/kittycad/models/file_conversion_status.py +++ b/kittycad/models/api_call_status.py @@ -1,7 +1,7 @@ from enum import Enum -class FileConversionStatus(str, Enum): +class APICallStatus(str, Enum): QUEUED = 'Queued' UPLOADED = 'Uploaded' IN_PROGRESS = 'In Progress' diff --git a/kittycad/models/async_api_call_output.py b/kittycad/models/async_api_call_output.py new file mode 100644 index 000000000..e69de29bb diff --git a/kittycad/models/billing_info.py b/kittycad/models/billing_info.py new file mode 100644 index 000000000..e11b75768 --- /dev/null +++ b/kittycad/models/billing_info.py @@ -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 diff --git a/kittycad/models/cache_metadata.py b/kittycad/models/cache_metadata.py new file mode 100644 index 000000000..a0d4cbc29 --- /dev/null +++ b/kittycad/models/cache_metadata.py @@ -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 diff --git a/kittycad/models/card_details.py b/kittycad/models/card_details.py new file mode 100644 index 000000000..bf8afed46 --- /dev/null +++ b/kittycad/models/card_details.py @@ -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 diff --git a/kittycad/models/code_language.py b/kittycad/models/code_language.py new file mode 100644 index 000000000..33eccd299 --- /dev/null +++ b/kittycad/models/code_language.py @@ -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) diff --git a/kittycad/models/file_conversion_results_page.py b/kittycad/models/code_output.py similarity index 52% rename from kittycad/models/file_conversion_results_page.py rename to kittycad/models/code_output.py index 5e77b3451..df0334a64 100644 --- a/kittycad/models/file_conversion_results_page.py +++ b/kittycad/models/code_output.py @@ -4,50 +4,52 @@ import attr from ..types import UNSET, Unset -T = TypeVar("T", bound="FileConversionResultsPage") +T = TypeVar("T", bound="CodeOutput") @attr.s(auto_attribs=True) -class FileConversionResultsPage: +class CodeOutput: """ """ - from ..models import FileConversion - items: Union[Unset, List[FileConversion]] = UNSET - next_page: Union[Unset, str] = UNSET + output: Union[Unset, str] = UNSET + stderr: Union[Unset, str] = UNSET + stdout: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - from ..models import FileConversion - items: Union[Unset, List[FileConversion]] = UNSET - if not isinstance(self.items, Unset): - items = self.items - next_page = self.next_page + output = self.output + stderr = self.stderr + stdout = self.stdout field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) - if items is not UNSET: - field_dict['items'] = items - if next_page is not UNSET: - field_dict['next_page'] = next_page + if output is not UNSET: + field_dict['output'] = output + if stderr is not UNSET: + field_dict['stderr'] = stderr + if stdout is not UNSET: + field_dict['stdout'] = stdout return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - from ..models import FileConversion - items = cast(List[FileConversion], d.pop("items", UNSET)) + output = d.pop("output", UNSET) - next_page = d.pop("next_page", UNSET) + stderr = d.pop("stderr", UNSET) - file_conversion_results_page = cls( - items=items, - next_page=next_page, + stdout = d.pop("stdout", UNSET) + + code_output = cls( + output=output, + stderr=stderr, + stdout=stdout, ) - file_conversion_results_page.additional_properties = d - return file_conversion_results_page + code_output.additional_properties = d + return code_output @property def additional_keys(self) -> List[str]: diff --git a/kittycad/models/nats_connection.py b/kittycad/models/connection.py similarity index 90% rename from kittycad/models/nats_connection.py rename to kittycad/models/connection.py index 053eab017..fd8e95178 100644 --- a/kittycad/models/nats_connection.py +++ b/kittycad/models/connection.py @@ -11,18 +11,18 @@ from ..models.leaf_node import LeafNode from ..models.duration import Duration from ..types import UNSET, Unset -T = TypeVar("T", bound="NatsConnection") +T = TypeVar("T", bound="Connection") @attr.s(auto_attribs=True) -class NatsConnection: +class Connection: """ """ auth_timeout: Union[Unset, int] = UNSET cluster: Union[Unset, Cluster] = UNSET config_load_time: Union[Unset, datetime.datetime] = UNSET connections: Union[Unset, int] = UNSET cores: Union[Unset, int] = UNSET - cpu: Union[Unset, int] = UNSET + cpu: Union[Unset, float] = UNSET gateway: Union[Unset, Gateway] = UNSET git_commit: Union[Unset, str] = UNSET go: Union[Unset, str] = UNSET diff --git a/kittycad/models/currency.py b/kittycad/models/currency.py new file mode 100644 index 000000000..47f1925c7 --- /dev/null +++ b/kittycad/models/currency.py @@ -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) diff --git a/kittycad/models/customer.py b/kittycad/models/customer.py new file mode 100644 index 000000000..0ba295e31 --- /dev/null +++ b/kittycad/models/customer.py @@ -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 diff --git a/kittycad/models/engine_metadata.py b/kittycad/models/engine_metadata.py index 6b19620e2..d213a0242 100644 --- a/kittycad/models/engine_metadata.py +++ b/kittycad/models/engine_metadata.py @@ -3,7 +3,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast import attr from ..models.file_system_metadata import FileSystemMetadata -from ..models.nats_connection import NatsConnection +from ..models.connection import Connection from ..types import UNSET, Unset T = TypeVar("T", bound="EngineMetadata") @@ -15,7 +15,7 @@ class EngineMetadata: async_jobs_running: Union[Unset, bool] = False fs: Union[Unset, FileSystemMetadata] = 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) @@ -25,9 +25,9 @@ class EngineMetadata: if not isinstance(self.fs, Unset): fs = self.fs.value git_hash = self.git_hash - nats: Union[Unset, str] = UNSET - if not isinstance(self.nats, Unset): - nats = self.nats.value + pubsub: Union[Unset, str] = UNSET + if not isinstance(self.pubsub, Unset): + pubsub = self.pubsub.value field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -38,8 +38,8 @@ class EngineMetadata: field_dict['fs'] = fs if git_hash is not UNSET: field_dict['git_hash'] = git_hash - if nats is not UNSET: - field_dict['nats'] = nats + if pubsub is not UNSET: + field_dict['pubsub'] = pubsub return field_dict @@ -57,18 +57,18 @@ class EngineMetadata: git_hash = d.pop("git_hash", UNSET) - _nats = d.pop("nats", UNSET) - nats: Union[Unset, NatsConnection] - if isinstance(_nats, Unset): - nats = UNSET + _pubsub = d.pop("pubsub", UNSET) + pubsub: Union[Unset, Connection] + if isinstance(_pubsub, Unset): + pubsub = UNSET else: - nats = NatsConnection(_nats) + pubsub = Connection(_pubsub) engine_metadata = cls( async_jobs_running=async_jobs_running, fs=fs, git_hash=git_hash, - nats=nats, + pubsub=pubsub, ) engine_metadata.additional_properties = d diff --git a/kittycad/models/environment.py b/kittycad/models/environment.py new file mode 100644 index 000000000..fa8519cc9 --- /dev/null +++ b/kittycad/models/environment.py @@ -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) diff --git a/kittycad/models/file_conversion.py b/kittycad/models/file_conversion.py index 619113000..27f6a9f93 100644 --- a/kittycad/models/file_conversion.py +++ b/kittycad/models/file_conversion.py @@ -5,9 +5,9 @@ import attr from dateutil.parser import isoparse from ..models.uuid import Uuid -from ..models.file_conversion_output_format import FileConversionOutputFormat -from ..models.file_conversion_source_format import FileConversionSourceFormat -from ..models.file_conversion_status import FileConversionStatus +from ..models.file_output_format import FileOutputFormat +from ..models.file_source_format import FileSourceFormat +from ..models.api_call_status import APICallStatus from ..types import UNSET, Unset T = TypeVar("T", bound="FileConversion") @@ -19,15 +19,13 @@ class FileConversion: completed_at: Union[Unset, datetime.datetime] = UNSET created_at: Union[Unset, datetime.datetime] = UNSET id: Union[Unset, Uuid] = UNSET - output_file_link: Union[Unset, str] = UNSET - output_format: Union[Unset, FileConversionOutputFormat] = UNSET - src_file_link: Union[Unset, str] = UNSET - src_format: Union[Unset, FileConversionSourceFormat] = UNSET + output: Union[Unset, str] = UNSET + output_format: Union[Unset, FileOutputFormat] = UNSET + src_format: Union[Unset, FileSourceFormat] = 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 user_id: Union[Unset, str] = UNSET - worker: Union[Unset, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -41,11 +39,10 @@ class FileConversion: id: Union[Unset, str] = UNSET if not isinstance(self.id, Unset): id = self.id.value - output_file_link = self.output_file_link + output = self.output output_format: Union[Unset, str] = UNSET if not isinstance(self.output_format, Unset): output_format = self.output_format.value - src_file_link = self.src_file_link src_format: Union[Unset, str] = UNSET if not isinstance(self.src_format, Unset): src_format = self.src_format.value @@ -59,7 +56,6 @@ class FileConversion: if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() user_id = self.user_id - worker = self.worker field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -70,12 +66,10 @@ class FileConversion: field_dict['created_at'] = created_at if id is not UNSET: field_dict['id'] = id - if output_file_link is not UNSET: - field_dict['output_file_link'] = output_file_link + if output is not UNSET: + field_dict['output'] = output if output_format is not UNSET: 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: field_dict['src_format'] = src_format if started_at is not UNSET: @@ -86,8 +80,6 @@ class FileConversion: field_dict['updated_at'] = updated_at if user_id is not UNSET: field_dict['user_id'] = user_id - if worker is not UNSET: - field_dict['worker'] = worker return field_dict @@ -115,23 +107,21 @@ class FileConversion: else: 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: Union[Unset, FileConversionOutputFormat] + output_format: Union[Unset, FileOutputFormat] if isinstance(_output_format, Unset): output_format = UNSET else: - output_format = FileConversionOutputFormat(_output_format) - - src_file_link = d.pop("src_file_link", UNSET) + output_format = FileOutputFormat(_output_format) _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileConversionSourceFormat] + src_format: Union[Unset, FileSourceFormat] if isinstance(_src_format, Unset): src_format = UNSET else: - src_format = FileConversionSourceFormat(_src_format) + src_format = FileSourceFormat(_src_format) _started_at = d.pop("started_at", UNSET) started_at: Union[Unset, datetime.datetime] @@ -141,11 +131,11 @@ class FileConversion: started_at = isoparse(_started_at) _status = d.pop("status", UNSET) - status: Union[Unset, FileConversionStatus] + status: Union[Unset, APICallStatus] if isinstance(_status, Unset): status = UNSET else: - status = FileConversionStatus(_status) + status = APICallStatus(_status) _updated_at = d.pop("updated_at", UNSET) updated_at: Union[Unset, datetime.datetime] @@ -156,21 +146,17 @@ class FileConversion: user_id = d.pop("user_id", UNSET) - worker = d.pop("worker", UNSET) - file_conversion = cls( completed_at=completed_at, created_at=created_at, id=id, - output_file_link=output_file_link, + output=output, output_format=output_format, - src_file_link=src_file_link, src_format=src_format, started_at=started_at, status=status, updated_at=updated_at, user_id=user_id, - worker=worker, ) file_conversion.additional_properties = d diff --git a/kittycad/models/file_conversion_with_output.py b/kittycad/models/file_mass.py similarity index 74% rename from kittycad/models/file_conversion_with_output.py rename to kittycad/models/file_mass.py index 664eba176..9aaa08f26 100644 --- a/kittycad/models/file_conversion_with_output.py +++ b/kittycad/models/file_mass.py @@ -5,25 +5,25 @@ import attr from dateutil.parser import isoparse from ..models.uuid import Uuid -from ..models.file_conversion_output_format import FileConversionOutputFormat -from ..models.file_conversion_source_format import FileConversionSourceFormat -from ..models.file_conversion_status import FileConversionStatus +from ..models.file_source_format import FileSourceFormat +from ..models.api_call_status import APICallStatus from ..types import UNSET, Unset -T = TypeVar("T", bound="FileConversionWithOutput") +T = TypeVar("T", bound="FileMass") @attr.s(auto_attribs=True) -class FileConversionWithOutput: +class FileMass: """ """ completed_at: Union[Unset, datetime.datetime] = UNSET created_at: Union[Unset, datetime.datetime] = UNSET + error: Union[Unset, str] = UNSET id: Union[Unset, Uuid] = UNSET - output: Union[Unset, str] = UNSET - output_format: Union[Unset, FileConversionOutputFormat] = UNSET - src_format: Union[Unset, FileConversionSourceFormat] = UNSET + mass: Union[Unset, float] = UNSET + material_density: Union[Unset, float] = UNSET + src_format: Union[Unset, FileSourceFormat] = 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 user_id: Union[Unset, str] = UNSET @@ -36,13 +36,12 @@ class FileConversionWithOutput: 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 - output = self.output - output_format: Union[Unset, str] = UNSET - if not isinstance(self.output_format, Unset): - output_format = self.output_format.value + mass = self.mass + material_density = self.material_density src_format: Union[Unset, str] = UNSET if not isinstance(self.src_format, Unset): src_format = self.src_format.value @@ -64,12 +63,14 @@ class FileConversionWithOutput: 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 output is not UNSET: - field_dict['output'] = output - if output_format is not UNSET: - field_dict['output_format'] = output_format + if mass is not UNSET: + field_dict['mass'] = mass + if material_density is not UNSET: + field_dict['material_density'] = material_density if src_format is not UNSET: field_dict['src_format'] = src_format if started_at is not UNSET: @@ -100,6 +101,8 @@ class FileConversionWithOutput: else: created_at = isoparse(_created_at) + error = d.pop("error", UNSET) + _id = d.pop("id", UNSET) id: Union[Unset, Uuid] if isinstance(_id, Unset): @@ -107,21 +110,16 @@ class FileConversionWithOutput: else: id = Uuid(_id) - output = d.pop("output", UNSET) + mass = d.pop("mass", UNSET) - _output_format = d.pop("output_format", UNSET) - output_format: Union[Unset, FileConversionOutputFormat] - if isinstance(_output_format, Unset): - output_format = UNSET - else: - output_format = FileConversionOutputFormat(_output_format) + material_density = d.pop("material_density", UNSET) _src_format = d.pop("src_format", UNSET) - src_format: Union[Unset, FileConversionSourceFormat] + src_format: Union[Unset, FileSourceFormat] if isinstance(_src_format, Unset): src_format = UNSET else: - src_format = FileConversionSourceFormat(_src_format) + src_format = FileSourceFormat(_src_format) _started_at = d.pop("started_at", UNSET) started_at: Union[Unset, datetime.datetime] @@ -131,11 +129,11 @@ class FileConversionWithOutput: started_at = isoparse(_started_at) _status = d.pop("status", UNSET) - status: Union[Unset, FileConversionStatus] + status: Union[Unset, APICallStatus] if isinstance(_status, Unset): status = UNSET else: - status = FileConversionStatus(_status) + status = APICallStatus(_status) _updated_at = d.pop("updated_at", UNSET) updated_at: Union[Unset, datetime.datetime] @@ -146,12 +144,13 @@ class FileConversionWithOutput: user_id = d.pop("user_id", UNSET) - file_conversion_with_output = cls( + file_mass = cls( completed_at=completed_at, created_at=created_at, + error=error, id=id, - output=output, - output_format=output_format, + mass=mass, + material_density=material_density, src_format=src_format, started_at=started_at, status=status, @@ -159,8 +158,8 @@ class FileConversionWithOutput: user_id=user_id, ) - file_conversion_with_output.additional_properties = d - return file_conversion_with_output + file_mass.additional_properties = d + return file_mass @property def additional_keys(self) -> List[str]: diff --git a/kittycad/models/file_conversion_output_format.py b/kittycad/models/file_output_format.py similarity index 80% rename from kittycad/models/file_conversion_output_format.py rename to kittycad/models/file_output_format.py index 5b64040a9..c2ce8b290 100644 --- a/kittycad/models/file_conversion_output_format.py +++ b/kittycad/models/file_output_format.py @@ -1,7 +1,7 @@ from enum import Enum -class FileConversionOutputFormat(str, Enum): +class FileOutputFormat(str, Enum): STL = 'stl' OBJ = 'obj' DAE = 'dae' diff --git a/kittycad/models/file_conversion_source_format.py b/kittycad/models/file_source_format.py similarity index 78% rename from kittycad/models/file_conversion_source_format.py rename to kittycad/models/file_source_format.py index 3a3545d7a..b8adc2cce 100644 --- a/kittycad/models/file_conversion_source_format.py +++ b/kittycad/models/file_source_format.py @@ -1,7 +1,7 @@ from enum import Enum -class FileConversionSourceFormat(str, Enum): +class FileSourceFormat(str, Enum): STL = 'stl' OBJ = 'obj' DAE = 'dae' diff --git a/kittycad/models/file_volume.py b/kittycad/models/file_volume.py new file mode 100644 index 000000000..464789c0e --- /dev/null +++ b/kittycad/models/file_volume.py @@ -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 diff --git a/kittycad/models/http_req_stats.py b/kittycad/models/http_req_stats.py deleted file mode 100644 index 34ba415aa..000000000 --- a/kittycad/models/http_req_stats.py +++ /dev/null @@ -1,4 +0,0 @@ -class http_req_stats(int): - - def __int__(self) -> int: - return self diff --git a/kittycad/models/invoice.py b/kittycad/models/invoice.py new file mode 100644 index 000000000..d55b26bfa --- /dev/null +++ b/kittycad/models/invoice.py @@ -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 import InvoiceLineItem + lines: Union[Unset, List[InvoiceLineItem]] = UNSET diff --git a/kittycad/models/invoice_line_item.py b/kittycad/models/invoice_line_item.py new file mode 100644 index 000000000..207dd1a80 --- /dev/null +++ b/kittycad/models/invoice_line_item.py @@ -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 diff --git a/kittycad/models/invoice_status.py b/kittycad/models/invoice_status.py new file mode 100644 index 000000000..a4a8c03bc --- /dev/null +++ b/kittycad/models/invoice_status.py @@ -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) diff --git a/kittycad/models/login_params.py b/kittycad/models/login_params.py new file mode 100644 index 000000000..3ec5a8f7b --- /dev/null +++ b/kittycad/models/login_params.py @@ -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 diff --git a/kittycad/models/metadata.py b/kittycad/models/metadata.py index f159f9228..fdd264535 100644 --- a/kittycad/models/metadata.py +++ b/kittycad/models/metadata.py @@ -2,9 +2,11 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast import attr +from ..models.cache_metadata import CacheMetadata from ..models.engine_metadata import EngineMetadata +from ..models.environment import Environment from ..models.file_system_metadata import FileSystemMetadata -from ..models.nats_connection import NatsConnection +from ..models.connection import Connection from ..types import UNSET, Unset T = TypeVar("T", bound="Metadata") @@ -13,42 +15,61 @@ T = TypeVar("T", bound="Metadata") @attr.s(auto_attribs=True) class Metadata: """ """ + cache: Union[Unset, CacheMetadata] = UNSET engine: Union[Unset, EngineMetadata] = UNSET + environment: Union[Unset, Environment] = UNSET fs: Union[Unset, FileSystemMetadata] = 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) 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 if not isinstance(self.engine, Unset): engine = self.engine.value + environment: Union[Unset, str] = UNSET + if not isinstance(self.environment, Unset): + environment = self.environment.value fs: Union[Unset, str] = UNSET if not isinstance(self.fs, Unset): fs = self.fs.value git_hash = self.git_hash - nats: Union[Unset, str] = UNSET - if not isinstance(self.nats, Unset): - nats = self.nats.value + pubsub: Union[Unset, str] = UNSET + if not isinstance(self.pubsub, Unset): + pubsub = self.pubsub.value field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if cache is not UNSET: + field_dict['cache'] = cache if engine is not UNSET: field_dict['engine'] = engine + if environment is not UNSET: + field_dict['environment'] = environment if fs is not UNSET: field_dict['fs'] = fs if git_hash is not UNSET: field_dict['git_hash'] = git_hash - if nats is not UNSET: - field_dict['nats'] = nats + if pubsub is not UNSET: + field_dict['pubsub'] = pubsub return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: 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: Union[Unset, EngineMetadata] if isinstance(_engine, Unset): @@ -56,6 +77,13 @@ class Metadata: else: 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: Union[Unset, FileSystemMetadata] if isinstance(_fs, Unset): @@ -65,18 +93,20 @@ class Metadata: git_hash = d.pop("git_hash", UNSET) - _nats = d.pop("nats", UNSET) - nats: Union[Unset, NatsConnection] - if isinstance(_nats, Unset): - nats = UNSET + _pubsub = d.pop("pubsub", UNSET) + pubsub: Union[Unset, Connection] + if isinstance(_pubsub, Unset): + pubsub = UNSET else: - nats = NatsConnection(_nats) + pubsub = Connection(_pubsub) metadata = cls( + cache=cache, engine=engine, + environment=environment, fs=fs, git_hash=git_hash, - nats=nats, + pubsub=pubsub, ) metadata.additional_properties = d diff --git a/kittycad/models/payment_intent.py b/kittycad/models/payment_intent.py new file mode 100644 index 000000000..264dd2251 --- /dev/null +++ b/kittycad/models/payment_intent.py @@ -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 diff --git a/kittycad/models/payment_method.py b/kittycad/models/payment_method.py new file mode 100644 index 000000000..33deb9078 --- /dev/null +++ b/kittycad/models/payment_method.py @@ -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 diff --git a/kittycad/models/payment_method_card_checks.py b/kittycad/models/payment_method_card_checks.py new file mode 100644 index 000000000..3d0870e55 --- /dev/null +++ b/kittycad/models/payment_method_card_checks.py @@ -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 diff --git a/kittycad/models/payment_method_type.py b/kittycad/models/payment_method_type.py new file mode 100644 index 000000000..e9adf754a --- /dev/null +++ b/kittycad/models/payment_method_type.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class PaymentMethodType(str, Enum): + CARD = 'card' + + def __str__(self) -> str: + return str(self.value) diff --git a/kittycad/models/update_user.py b/kittycad/models/update_user.py new file mode 100644 index 000000000..9d0d95b93 --- /dev/null +++ b/kittycad/models/update_user.py @@ -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 diff --git a/spec.json b/spec.json index b61033d43..ecf619abf 100644 --- a/spec.json +++ b/spec.json @@ -1,5812 +1,6363 @@ { - "components": { - "responses": { - "Error": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" + "components": { + "responses": { + "Error": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error", + "x-scope": [ + "", + "#/components/responses/Error" + ] + } + } + }, + "description": "Error" } - } }, - "description": "Error" - } - }, - "schemas": { - "APICallStatus": { - "description": "The status of an async API call.", - "enum": [ - "Queued", - "Uploaded", - "In Progress", - "Completed", - "Failed" - ], - "type": "string" - }, - "Address": { - "description": "An address.", - "properties": { - "city": { - "description": "The city component.", - "type": "string" - }, - "country": { - "description": "The country component.", - "type": "string" - }, - "created_at": { - "description": "The time and date the address was created.", - "format": "partial-date-time", - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier of the address." - }, - "state": { - "description": "The state component.", - "type": "string" - }, - "street1": { - "description": "The first street component.", - "type": "string" - }, - "street2": { - "description": "The second street component.", - "type": "string" - }, - "updated_at": { - "description": "The time and date the address was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID that this address belongs to.", - "type": "string" - }, - "zip": { - "description": "The zip component.", - "type": "string" - } - }, - "required": [ - "created_at", - "id", - "updated_at" - ], - "type": "object" - }, - "ApiCallQueryGroup": { - "description": "A response for a query on the API call table that is grouped by something.", - "properties": { - "count": { - "format": "int64", - "type": "integer" - }, - "query": { - "type": "string" - } - }, - "required": [ - "count", - "query" - ], - "type": "object" - }, - "ApiCallQueryGroupBy": { - "description": "The field of an API call to group by.", - "enum": [ - "email", - "method", - "endpoint", - "user_id", - "origin", - "ip_address" - ], - "type": "string" - }, - "ApiCallWithPrice": { - "description": "An API call with the price.\n\nThis is a join of the `APICall` and `APICallPrice` tables.", - "properties": { - "completed_at": { - "description": "The date and time the API call completed billing.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The date and time the API call was created.", - "format": "partial-date-time", - "type": "string" - }, - "duration": { - "description": "The duration of the API call.", - "format": "int64", - "nullable": true, - "type": "integer" - }, - "email": { - "description": "The user's email address.", - "type": "string" - }, - "endpoint": { - "description": "The endpoint requested by the API call.", - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier for the API call." - }, - "ip_address": { - "description": "The ip address of the origin.", - "type": "string" - }, - "method": { - "allOf": [ - { - "$ref": "#/components/schemas/Method" - } - ], - "description": "The HTTP method requsted by the API call." - }, - "minutes": { - "description": "The number of minutes the API call was billed for.", - "format": "int32", - "nullable": true, - "type": "integer" - }, - "origin": { - "description": "The origin of the API call.", - "type": "string" - }, - "price": { - "description": "The price of the API call.", - "nullable": true, - "type": "number" - }, - "request_body": { - "description": "The request body sent by the API call.", - "nullable": true, - "type": "string" - }, - "request_query_params": { - "description": "The request query params sent by the API call.", - "type": "string" - }, - "response_body": { - "description": "The response body returned by the API call. We do not store this information if it is above a certain size.", - "nullable": true, - "type": "string" - }, - "started_at": { - "description": "The date and time the API call started billing.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status_code": { - "allOf": [ - { - "$ref": "#/components/schemas/StatusCode" - } - ], - "description": "The status code returned by the API call.", - "nullable": true - }, - "stripe_invoice_item_id": { - "description": "The Stripe invoice item ID of the API call if it is billable.", - "type": "string" - }, - "token": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The API token that made the API call." - }, - "updated_at": { - "description": "The date and time the API call was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_agent": { - "description": "The user agent of the request.", - "type": "string" - }, - "user_id": { - "description": "The ID of the user that made the API call.", - "type": "string" - } - }, - "required": [ - "created_at", - "id", - "method", - "token", - "updated_at", - "user_agent" - ], - "type": "object" - }, - "ApiCallWithPriceResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/ApiCallWithPrice" - }, - "type": "array" - }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, - "type": "string" - } - }, - "required": [ - "items" - ], - "type": "object" - }, - "ApiToken": { - "description": "An API token.\n\nThese are used to authenticate users with Bearer authentication.", - "properties": { - "created_at": { - "description": "The date and time the API token was created.", - "format": "partial-date-time", - "type": "string" - }, - "id": { - "description": "The unique identifier for the API token.", - "type": "string" - }, - "is_valid": { - "description": "If the token is valid. We never delete API tokens, but we can mark them as invalid. We save them for ever to preserve the history of the API token.", - "type": "boolean" - }, - "token": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The API token itself." - }, - "updated_at": { - "description": "The date and time the API token was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The ID of the user that owns the API token.", - "type": "string" - } - }, - "required": [ - "created_at", - "is_valid", - "token", - "updated_at" - ], - "type": "object" - }, - "ApiTokenResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/ApiToken" - }, - "type": "array" - }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, - "type": "string" - } - }, - "required": [ - "items" - ], - "type": "object" - }, - "AsyncApiCallOutput": { - "description": "The output from the async API call.", - "oneOf": [ - { - "description": "A file conversion.", - "properties": { - "completed_at": { - "description": "The time and date the file conversion was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the file conversion was created.", - "format": "partial-date-time", - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." - }, - "output": { - "description": "The converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors.", - "type": "string" - }, - "output_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileOutputFormat" - } - ], - "description": "The output format of the file conversion." - }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSourceFormat" - } - ], - "description": "The source format of the file conversion." - }, - "started_at": { - "description": "The time and date the file conversion was started.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/APICallStatus" - } - ], - "description": "The status of the file conversion." - }, - "type": { + "schemas": { + "APICallStatus": { + "description": "The status of an async API call.", "enum": [ - "FileConversion" + "Queued", + "Uploaded", + "In Progress", + "Completed", + "Failed" ], "type": "string" - }, - "updated_at": { - "description": "The time and date the file conversion was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID of the user who created the file conversion.", - "type": "string" - } }, - "required": [ - "created_at", - "id", - "output_format", - "src_format", - "status", - "type", - "updated_at" - ], - "type": "object" - }, - { - "description": "A file mass.", - "properties": { - "completed_at": { - "description": "The time and date the mass was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the mass was created.", - "format": "partial-date-time", - "type": "string" - }, - "error": { - "description": "The error the function returned, if any.", - "nullable": true, - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } + "Address": { + "description": "An address.", + "properties": { + "city": { + "description": "The city component.", + "type": "string" + }, + "country": { + "description": "The country component.", + "type": "string" + }, + "created_at": { + "description": "The time and date the address was created.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/Customer", + "#/components/schemas/Address" + ] + } + ], + "description": "The unique identifier of the address." + }, + "state": { + "description": "The state component.", + "type": "string" + }, + "street1": { + "description": "The first street component.", + "type": "string" + }, + "street2": { + "description": "The second street component.", + "type": "string" + }, + "updated_at": { + "description": "The time and date the address was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID that this address belongs to.", + "type": "string" + }, + "zip": { + "description": "The zip component.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "updated_at" ], - "description": "The unique identifier of the mass request.\n\nThis is the same as the API call ID." - }, - "mass": { - "description": "The resulting mass.", - "format": "float", - "nullable": true, - "type": "number" - }, - "material_density": { - "default": 0, - "description": "The material density as denoted by the user.", - "format": "float", - "type": "number" - }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSourceFormat" - } + "type": "object" + }, + "ApiCallQueryGroup": { + "description": "A response for a query on the API call table that is grouped by something.", + "properties": { + "count": { + "format": "int64", + "type": "integer" + }, + "query": { + "type": "string" + } + }, + "required": [ + "count", + "query" ], - "description": "The source format of the file." - }, - "started_at": { - "description": "The time and date the mass was started.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/APICallStatus" - } - ], - "description": "The status of the mass." - }, - "type": { + "type": "object" + }, + "ApiCallQueryGroupBy": { + "description": "The field of an API call to group by.", "enum": [ - "FileMass" + "email", + "method", + "endpoint", + "user_id", + "origin", + "ip_address" ], "type": "string" - }, - "updated_at": { - "description": "The time and date the mass was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID of the user who created the mass.", - "type": "string" - } }, - "required": [ - "created_at", - "id", - "src_format", - "status", - "type", - "updated_at" - ], - "type": "object" - }, - { - "description": "A file volume.", - "properties": { - "completed_at": { - "description": "The time and date the volume was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the volume was created.", - "format": "partial-date-time", - "type": "string" - }, - "error": { - "description": "The error the function returned, if any.", - "nullable": true, - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } + "ApiCallWithPrice": { + "description": "An API call with the price.\n\nThis is a join of the `APICall` and `APICallPrice` tables.", + "properties": { + "completed_at": { + "description": "The date and time the API call completed billing.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The date and time the API call was created.", + "format": "partial-date-time", + "type": "string" + }, + "duration": { + "description": "The duration of the API call.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "email": { + "description": "The user's email address.", + "type": "string" + }, + "endpoint": { + "description": "The endpoint requested by the API call.", + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/ApiCallWithPriceResultsPage", + "#/components/schemas/ApiCallWithPrice" + ] + } + ], + "description": "The unique identifier for the API call." + }, + "ip_address": { + "description": "The ip address of the origin.", + "type": "string" + }, + "method": { + "allOf": [ + { + "$ref": "#/components/schemas/Method", + "x-scope": [ + "", + "#/components/schemas/ApiCallWithPriceResultsPage", + "#/components/schemas/ApiCallWithPrice" + ] + } + ], + "description": "The HTTP method requsted by the API call." + }, + "minutes": { + "description": "The number of minutes the API call was billed for.", + "format": "int32", + "nullable": true, + "type": "integer" + }, + "origin": { + "description": "The origin of the API call.", + "type": "string" + }, + "price": { + "description": "The price of the API call.", + "nullable": true, + "type": "number" + }, + "request_body": { + "description": "The request body sent by the API call.", + "nullable": true, + "type": "string" + }, + "request_query_params": { + "description": "The request query params sent by the API call.", + "type": "string" + }, + "response_body": { + "description": "The response body returned by the API call. We do not store this information if it is above a certain size.", + "nullable": true, + "type": "string" + }, + "started_at": { + "description": "The date and time the API call started billing.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status_code": { + "allOf": [ + { + "$ref": "#/components/schemas/StatusCode", + "x-scope": [ + "", + "#/components/schemas/ApiCallWithPriceResultsPage", + "#/components/schemas/ApiCallWithPrice" + ] + } + ], + "description": "The status code returned by the API call.", + "nullable": true + }, + "stripe_invoice_item_id": { + "description": "The Stripe invoice item ID of the API call if it is billable.", + "type": "string" + }, + "token": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/ApiCallWithPriceResultsPage", + "#/components/schemas/ApiCallWithPrice" + ] + } + ], + "description": "The API token that made the API call." + }, + "updated_at": { + "description": "The date and time the API call was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_agent": { + "description": "The user agent of the request.", + "type": "string" + }, + "user_id": { + "description": "The ID of the user that made the API call.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "method", + "token", + "updated_at", + "user_agent" ], - "description": "The unique identifier of the volume request.\n\nThis is the same as the API call ID." - }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSourceFormat" - } + "type": "object" + }, + "ApiCallWithPriceResultsPage": { + "description": "A single page of results", + "properties": { + "items": { + "description": "list of items on this page of results", + "items": { + "$ref": "#/components/schemas/ApiCallWithPrice", + "x-scope": [ + "", + "#/components/schemas/ApiCallWithPriceResultsPage" + ] + }, + "type": "array" + }, + "next_page": { + "description": "token used to fetch the next page of results (if any)", + "nullable": true, + "type": "string" + } + }, + "required": [ + "items" ], - "description": "The source format of the file." - }, - "started_at": { - "description": "The time and date the volume was started.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/APICallStatus" - } + "type": "object" + }, + "ApiToken": { + "description": "An API token.\n\nThese are used to authenticate users with Bearer authentication.", + "properties": { + "created_at": { + "description": "The date and time the API token was created.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "description": "The unique identifier for the API token.", + "type": "string" + }, + "is_valid": { + "description": "If the token is valid. We never delete API tokens, but we can mark them as invalid. We save them for ever to preserve the history of the API token.", + "type": "boolean" + }, + "token": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/ApiTokenResultsPage", + "#/components/schemas/ApiToken" + ] + } + ], + "description": "The API token itself." + }, + "updated_at": { + "description": "The date and time the API token was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The ID of the user that owns the API token.", + "type": "string" + } + }, + "required": [ + "created_at", + "is_valid", + "token", + "updated_at" ], - "description": "The status of the volume." - }, - "type": { + "type": "object" + }, + "ApiTokenResultsPage": { + "description": "A single page of results", + "properties": { + "items": { + "description": "list of items on this page of results", + "items": { + "$ref": "#/components/schemas/ApiToken", + "x-scope": [ + "", + "#/components/schemas/ApiTokenResultsPage" + ] + }, + "type": "array" + }, + "next_page": { + "description": "token used to fetch the next page of results (if any)", + "nullable": true, + "type": "string" + } + }, + "required": [ + "items" + ], + "type": "object" + }, + "AsyncApiCallOutput": { + "description": "The output from the async API call.", + "oneOf": [ + { + "$ref": "#/components/schemas/FileConversion", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput" + ] + }, + { + "$ref": "#/components/schemas/FileMass", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput" + ] + }, + { + "$ref": "#/components/schemas/FileVolume", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput" + ] + } + ] + }, + "BillingInfo": { + "description": "The billing information for payments.", + "properties": { + "address": { + "allOf": [ + { + "$ref": "#/components/schemas/Address", + "x-scope": [ + "", + "#/components/schemas/BillingInfo" + ] + } + ], + "description": "The address of the customer.", + "nullable": true + }, + "name": { + "description": "The name of the customer.", + "type": "string" + }, + "phone": { + "description": "The phone for the customer.", + "type": "string" + } + }, + "type": "object" + }, + "CacheMetadata": { + "description": "Metadata about our cache.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "ok": { + "description": "If the cache returned an ok response from ping.", + "type": "boolean" + } + }, + "required": [ + "ok" + ], + "type": "object" + }, + "CardDetails": { + "description": "The card details of a payment method.", + "properties": { + "brand": { + "description": "Card brand.\n\nCan be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", + "type": "string" + }, + "checks": { + "allOf": [ + { + "$ref": "#/components/schemas/PaymentMethodCardChecks", + "x-scope": [ + "", + "#/components/schemas/PaymentMethod", + "#/components/schemas/CardDetails" + ] + } + ], + "default": {}, + "description": "Checks on Card address and CVC if provided." + }, + "country": { + "description": "Two-letter ISO code representing the country of the card.", + "type": "string" + }, + "exp_month": { + "default": 0, + "description": "Two-digit number representing the card's expiration month.", + "format": "int64", + "type": "integer" + }, + "exp_year": { + "default": 0, + "description": "Four-digit number representing the card's expiration year.", + "format": "int64", + "type": "integer" + }, + "fingerprint": { + "description": "Uniquely identifies this particular card number.", + "type": "string" + }, + "funding": { + "description": "Card funding type.\n\nCan be `credit`, `debit`, `prepaid`, or `unknown`.", + "type": "string" + }, + "last4": { + "description": "The last four digits of the card.", + "type": "string" + } + }, + "type": "object" + }, + "Cluster": { + "description": "Cluster information.", + "properties": { + "addr": { + "description": "The IP address of the cluster.", + "format": "ip", + "nullable": true, + "type": "string" + }, + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the cluster.", + "format": "int64", + "type": "integer" + }, + "cluster_port": { + "default": 0, + "description": "The port of the cluster.", + "format": "int64", + "type": "integer" + }, + "name": { + "description": "The name of the cluster.", + "type": "string" + }, + "tls_timeout": { + "default": 0, + "description": "The TLS timeout for the cluster.", + "format": "int64", + "type": "integer" + }, + "urls": { + "description": "The urls of the cluster.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "CodeLanguage": { + "description": "The language code is written in.", "enum": [ - "FileVolume" + "go", + "rust", + "python", + "node" ], "type": "string" - }, - "updated_at": { - "description": "The time and date the volume was last updated.", - "format": "partial-date-time", + }, + "CodeOutput": { + "description": "Output of the code being executed.", + "properties": { + "output": { + "description": "The contents of the output file if it was passed. This is base64 encoded so we can ensure it is UTF-8 for JSON.", + "type": "string" + }, + "stderr": { + "description": "The stderr of the code.", + "type": "string" + }, + "stdout": { + "description": "The stdout of the code.", + "type": "string" + } + }, + "required": [ + "output", + "stderr", + "stdout" + ], + "type": "object" + }, + "Connection": { + "description": "Metadata about a pub-sub connection.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the server.", + "format": "int64", + "type": "integer" + }, + "cluster": { + "allOf": [ + { + "$ref": "#/components/schemas/Cluster", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection" + ] + } + ], + "default": { + "auth_timeout": 0, + "cluster_port": 0, + "tls_timeout": 0 + }, + "description": "Information about the cluster." + }, + "config_load_time": { + "description": "The time the configuration was loaded.", + "format": "date-time", + "type": "string" + }, + "connections": { + "default": 0, + "description": "The number of connections to the server.", + "format": "int64", + "type": "integer" + }, + "cores": { + "default": 0, + "description": "The CPU core usage of the server.", + "format": "int64", + "type": "integer" + }, + "cpu": { + "default": 0, + "description": "The CPU usage of the server.", + "format": "double", + "type": "number" + }, + "gateway": { + "allOf": [ + { + "$ref": "#/components/schemas/Gateway", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection" + ] + } + ], + "default": { + "auth_timeout": 0, + "port": 0, + "tls_timeout": 0 + }, + "description": "Information about the gateway." + }, + "git_commit": { + "description": "The git commit.", + "type": "string" + }, + "go": { + "description": "The go version.", + "type": "string" + }, + "gomaxprocs": { + "default": 0, + "description": "`GOMAXPROCS` of the server.", + "format": "int64", + "type": "integer" + }, + "host": { + "description": "The host of the server.", + "format": "ip", + "type": "string" + }, + "http_base_path": { + "description": "The http base path of the server.", + "type": "string" + }, + "http_host": { + "description": "The http host of the server.", + "type": "string" + }, + "http_port": { + "default": 0, + "description": "The http port of the server.", + "format": "int64", + "type": "integer" + }, + "http_req_stats": { + "additionalProperties": { + "format": "int64", + "type": "integer" + }, + "description": "HTTP request statistics.", + "type": "object" + }, + "https_port": { + "default": 0, + "description": "The https port of the server.", + "format": "int64", + "type": "integer" + }, + "id": { + "description": "The ID as known by the most recently connected server.", + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "in_bytes": { + "default": 0, + "description": "The count of inbound bytes for the server.", + "format": "int64", + "type": "integer" + }, + "in_msgs": { + "default": 0, + "description": "The number of inbound messages for the server.", + "format": "int64", + "type": "integer" + }, + "ip": { + "description": "The client IP as known by the most recently connected server.", + "format": "ip", + "type": "string" + }, + "jetstream": { + "allOf": [ + { + "$ref": "#/components/schemas/Jetstream", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection" + ] + } + ], + "default": { + "config": { + "max_memory": 0, + "max_storage": 0 + }, + "meta": { + "cluster_size": 0 + }, + "stats": { + "accounts": 0, + "api": { + "errors": 0, + "inflight": 0, + "total": 0 + }, + "ha_assets": 0, + "memory": 0, + "reserved_memory": 0, + "reserved_store": 0, + "store": 0 + } + }, + "description": "Jetstream information." + }, + "leaf": { + "allOf": [ + { + "$ref": "#/components/schemas/LeafNode", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection" + ] + } + ], + "default": { + "auth_timeout": 0, + "port": 0, + "tls_timeout": 0 + }, + "description": "Information about leaf nodes." + }, + "leafnodes": { + "default": 0, + "description": "The number of leaf nodes for the server.", + "format": "int64", + "type": "integer" + }, + "max_connections": { + "default": 0, + "description": "The max connections of the server.", + "format": "int64", + "type": "integer" + }, + "max_control_line": { + "default": 0, + "description": "The max control line of the server.", + "format": "int64", + "type": "integer" + }, + "max_payload": { + "default": 0, + "description": "The max payload of the server.", + "format": "int64", + "type": "integer" + }, + "max_pending": { + "default": 0, + "description": "The max pending of the server.", + "format": "int64", + "type": "integer" + }, + "mem": { + "default": 0, + "description": "The memory usage of the server.", + "format": "int64", + "type": "integer" + }, + "now": { + "description": "The time now.", + "format": "date-time", + "type": "string" + }, + "out_bytes": { + "default": 0, + "description": "The count of outbound bytes for the server.", + "format": "int64", + "type": "integer" + }, + "out_msgs": { + "default": 0, + "description": "The number of outbound messages for the server.", + "format": "int64", + "type": "integer" + }, + "ping_interval": { + "default": 0, + "description": "The ping interval of the server.", + "format": "int64", + "type": "integer" + }, + "ping_max": { + "default": 0, + "description": "The ping max of the server.", + "format": "int64", + "type": "integer" + }, + "port": { + "default": 0, + "description": "The port of the server.", + "format": "int64", + "type": "integer" + }, + "proto": { + "default": 0, + "description": "The protocol version.", + "format": "int64", + "type": "integer" + }, + "remotes": { + "default": 0, + "description": "The number of remotes for the server.", + "format": "int64", + "type": "integer" + }, + "routes": { + "default": 0, + "description": "The number of routes for the server.", + "format": "int64", + "type": "integer" + }, + "rtt": { + "allOf": [ + { + "$ref": "#/components/schemas/Duration", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection" + ] + } + ], + "description": "The round trip time between this client and the server." + }, + "server_id": { + "description": "The server ID.", + "type": "string" + }, + "server_name": { + "description": "The server name.", + "type": "string" + }, + "slow_consumers": { + "default": 0, + "description": "The number of slow consumers for the server.", + "format": "int64", + "type": "integer" + }, + "start": { + "description": "When the server was started.", + "format": "date-time", + "type": "string" + }, + "subscriptions": { + "default": 0, + "description": "The number of subscriptions for the server.", + "format": "int64", + "type": "integer" + }, + "system_account": { + "description": "The system account.", + "type": "string" + }, + "tls_timeout": { + "default": 0, + "description": "The TLS timeout of the server.", + "format": "int64", + "type": "integer" + }, + "total_connections": { + "default": 0, + "description": "The total number of connections to the server.", + "format": "int64", + "type": "integer" + }, + "uptime": { + "description": "The uptime of the server.", + "type": "string" + }, + "version": { + "description": "The version of the service.", + "type": "string" + }, + "write_deadline": { + "default": 0, + "description": "The write deadline of the server.", + "format": "int64", + "type": "integer" + } + }, + "required": [ + "config_load_time", + "host", + "http_req_stats", + "id", + "ip", + "now", + "rtt", + "start" + ], + "type": "object" + }, + "CreatedAtSortMode": { + "description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.", + "enum": [ + "created-at-ascending", + "created-at-descending" + ], "type": "string" - }, - "user_id": { - "description": "The user ID of the user who created the volume.", + }, + "Currency": { + "description": "Currency is the list of supported currencies.\n\nFor more details see .", + "enum": [ + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bif", + "bmd", + "bnd", + "bob", + "brl", + "bsd", + "bwp", + "bzd", + "cad", + "cdf", + "chf", + "clp", + "cny", + "cop", + "crc", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "isk", + "jmd", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "krw", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "mad", + "mdl", + "mga", + "mkd", + "mnt", + "mop", + "mro", + "mur", + "mvr", + "mwk", + "mxn", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sek", + "sgd", + "shp", + "sll", + "sos", + "srd", + "std", + "svc", + "szl", + "thb", + "tjs", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "uyu", + "uzs", + "vef", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xof", + "xpf", + "yer", + "zar", + "zmw" + ], "type": "string" - }, - "volume": { - "description": "The resulting volume.", - "format": "float", - "nullable": true, - "type": "number" - } }, - "required": [ - "created_at", - "id", - "src_format", - "status", - "type", - "updated_at" - ], - "type": "object" - } - ] - }, - "BillingInfo": { - "description": "The billing information for payments.", - "properties": { - "address": { - "allOf": [ - { - "$ref": "#/components/schemas/Address" - } - ], - "description": "The address of the customer.", - "nullable": true - }, - "name": { - "description": "The name of the customer.", - "type": "string" - }, - "phone": { - "description": "The phone for the customer.", - "type": "string" - } - }, - "type": "object" - }, - "CacheMetadata": { - "description": "Metadata about our cache.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "ok": { - "description": "If the cache returned an ok response from ping.", - "type": "boolean" - } - }, - "required": [ - "ok" - ], - "type": "object" - }, - "CardDetails": { - "description": "The card details of a payment method.", - "properties": { - "brand": { - "description": "Card brand.\n\nCan be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "type": "string" - }, - "checks": { - "allOf": [ - { - "$ref": "#/components/schemas/PaymentMethodCardChecks" - } - ], - "default": {}, - "description": "Checks on Card address and CVC if provided." - }, - "country": { - "description": "Two-letter ISO code representing the country of the card.", - "type": "string" - }, - "exp_month": { - "default": 0, - "description": "Two-digit number representing the card's expiration month.", - "format": "int64", - "type": "integer" - }, - "exp_year": { - "default": 0, - "description": "Four-digit number representing the card's expiration year.", - "format": "int64", - "type": "integer" - }, - "fingerprint": { - "description": "Uniquely identifies this particular card number.", - "type": "string" - }, - "funding": { - "description": "Card funding type.\n\nCan be `credit`, `debit`, `prepaid`, or `unknown`.", - "type": "string" - }, - "last4": { - "description": "The last four digits of the card.", - "type": "string" - } - }, - "type": "object" - }, - "Cluster": { - "description": "Cluster information.", - "properties": { - "addr": { - "description": "The IP address of the cluster.", - "format": "ip", - "nullable": true, - "type": "string" - }, - "auth_timeout": { - "default": 0, - "description": "The auth timeout of the cluster.", - "format": "int64", - "type": "integer" - }, - "cluster_port": { - "default": 0, - "description": "The port of the cluster.", - "format": "int64", - "type": "integer" - }, - "name": { - "description": "The name of the cluster.", - "type": "string" - }, - "tls_timeout": { - "default": 0, - "description": "The TLS timeout for the cluster.", - "format": "int64", - "type": "integer" - }, - "urls": { - "description": "The urls of the cluster.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "CodeLanguage": { - "description": "The language code is written in.", - "enum": [ - "go", - "rust", - "python", - "node" - ], - "type": "string" - }, - "CodeOutput": { - "description": "Output of the code being executed.", - "properties": { - "output": { - "description": "The contents of the output file if it was passed. This is base64 encoded so we can ensure it is UTF-8 for JSON.", - "type": "string" - }, - "stderr": { - "description": "The stderr of the code.", - "type": "string" - }, - "stdout": { - "description": "The stdout of the code.", - "type": "string" - } - }, - "required": [ - "output", - "stderr", - "stdout" - ], - "type": "object" - }, - "Connection": { - "description": "Metadata about a pub-sub connection.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "auth_timeout": { - "default": 0, - "description": "The auth timeout of the server.", - "format": "int64", - "type": "integer" - }, - "cluster": { - "allOf": [ - { - "$ref": "#/components/schemas/Cluster" - } - ], - "default": { - "auth_timeout": 0, - "cluster_port": 0, - "tls_timeout": 0 - }, - "description": "Information about the cluster." - }, - "config_load_time": { - "description": "The time the configuration was loaded.", - "format": "date-time", - "type": "string" - }, - "connections": { - "default": 0, - "description": "The number of connections to the server.", - "format": "int64", - "type": "integer" - }, - "cores": { - "default": 0, - "description": "The CPU core usage of the server.", - "format": "int64", - "type": "integer" - }, - "cpu": { - "default": 0, - "description": "The CPU usage of the server.", - "format": "double", - "type": "number" - }, - "gateway": { - "allOf": [ - { - "$ref": "#/components/schemas/Gateway" - } - ], - "default": { - "auth_timeout": 0, - "port": 0, - "tls_timeout": 0 - }, - "description": "Information about the gateway." - }, - "git_commit": { - "description": "The git commit.", - "type": "string" - }, - "go": { - "description": "The go version.", - "type": "string" - }, - "gomaxprocs": { - "default": 0, - "description": "`GOMAXPROCS` of the server.", - "format": "int64", - "type": "integer" - }, - "host": { - "description": "The host of the server.", - "format": "ip", - "type": "string" - }, - "http_base_path": { - "description": "The http base path of the server.", - "type": "string" - }, - "http_host": { - "description": "The http host of the server.", - "type": "string" - }, - "http_port": { - "default": 0, - "description": "The http port of the server.", - "format": "int64", - "type": "integer" - }, - "http_req_stats": { - "additionalProperties": { - "format": "int64", - "type": "integer" - }, - "description": "HTTP request statistics.", - "type": "object" - }, - "https_port": { - "default": 0, - "description": "The https port of the server.", - "format": "int64", - "type": "integer" - }, - "id": { - "description": "The ID as known by the most recently connected server.", - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "in_bytes": { - "default": 0, - "description": "The count of inbound bytes for the server.", - "format": "int64", - "type": "integer" - }, - "in_msgs": { - "default": 0, - "description": "The number of inbound messages for the server.", - "format": "int64", - "type": "integer" - }, - "ip": { - "description": "The client IP as known by the most recently connected server.", - "format": "ip", - "type": "string" - }, - "jetstream": { - "allOf": [ - { - "$ref": "#/components/schemas/Jetstream" - } - ], - "default": { - "config": { - "max_memory": 0, - "max_storage": 0 - }, - "meta": { - "cluster_size": 0 - }, - "stats": { - "accounts": 0, - "api": { - "errors": 0, - "inflight": 0, - "total": 0 + "Customer": { + "description": "The resource representing a payment \"Customer\".", + "properties": { + "address": { + "allOf": [ + { + "$ref": "#/components/schemas/Address", + "x-scope": [ + "", + "#/components/schemas/Customer" + ] + } + ], + "description": "The customer's address.", + "nullable": true + }, + "balance": { + "default": 0, + "description": "Current balance, if any, being stored on the customer.\n\nIf negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.", + "format": "int64", + "type": "integer" + }, + "created_at": { + "description": "Time at which the object was created.", + "format": "date-time", + "type": "string" + }, + "currency": { + "allOf": [ + { + "$ref": "#/components/schemas/Currency", + "x-scope": [ + "", + "#/components/schemas/Customer" + ] + } + ], + "description": "Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes." + }, + "delinquent": { + "default": false, + "description": "When the customer's latest invoice is billed by charging automatically, `delinquent` is `true` if the invoice's latest charge failed.\n\nWhen the customer's latest invoice is billed by sending an invoice, `delinquent` is `true` if the invoice isn't paid by its due date. If an invoice is marked uncollectible by dunning, `delinquent` doesn't get reset to `false`.", + "type": "boolean" + }, + "email": { + "description": "The customer's email address.", + "type": "string" + }, + "id": { + "description": "Unique identifier for the object.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of key-value pairs.", + "type": "object" + }, + "name": { + "description": "The customer's full name or business name.", + "type": "string" + }, + "phone": { + "description": "The customer's phone number.", + "type": "string" + } }, - "ha_assets": 0, - "memory": 0, - "reserved_memory": 0, - "reserved_store": 0, - "store": 0 - } + "required": [ + "created_at", + "currency" + ], + "type": "object" }, - "description": "Jetstream information." - }, - "leaf": { - "allOf": [ - { - "$ref": "#/components/schemas/LeafNode" - } - ], - "default": { - "auth_timeout": 0, - "port": 0, - "tls_timeout": 0 + "Duration": { + "format": "int64", + "title": "int64", + "type": "integer" }, - "description": "Information about leaf nodes." - }, - "leafnodes": { - "default": 0, - "description": "The number of leaf nodes for the server.", - "format": "int64", - "type": "integer" - }, - "max_connections": { - "default": 0, - "description": "The max connections of the server.", - "format": "int64", - "type": "integer" - }, - "max_control_line": { - "default": 0, - "description": "The max control line of the server.", - "format": "int64", - "type": "integer" - }, - "max_payload": { - "default": 0, - "description": "The max payload of the server.", - "format": "int64", - "type": "integer" - }, - "max_pending": { - "default": 0, - "description": "The max pending of the server.", - "format": "int64", - "type": "integer" - }, - "mem": { - "default": 0, - "description": "The memory usage of the server.", - "format": "int64", - "type": "integer" - }, - "now": { - "description": "The time now.", - "format": "date-time", - "type": "string" - }, - "out_bytes": { - "default": 0, - "description": "The count of outbound bytes for the server.", - "format": "int64", - "type": "integer" - }, - "out_msgs": { - "default": 0, - "description": "The number of outbound messages for the server.", - "format": "int64", - "type": "integer" - }, - "ping_interval": { - "default": 0, - "description": "The ping interval of the server.", - "format": "int64", - "type": "integer" - }, - "ping_max": { - "default": 0, - "description": "The ping max of the server.", - "format": "int64", - "type": "integer" - }, - "port": { - "default": 0, - "description": "The port of the server.", - "format": "int64", - "type": "integer" - }, - "proto": { - "default": 0, - "description": "The protocol version.", - "format": "int64", - "type": "integer" - }, - "remotes": { - "default": 0, - "description": "The number of remotes for the server.", - "format": "int64", - "type": "integer" - }, - "routes": { - "default": 0, - "description": "The number of routes for the server.", - "format": "int64", - "type": "integer" - }, - "rtt": { - "allOf": [ - { - "$ref": "#/components/schemas/Duration" - } - ], - "description": "The round trip time between this client and the server." - }, - "server_id": { - "description": "The server ID.", - "type": "string" - }, - "server_name": { - "description": "The server name.", - "type": "string" - }, - "slow_consumers": { - "default": 0, - "description": "The number of slow consumers for the server.", - "format": "int64", - "type": "integer" - }, - "start": { - "description": "When the server was started.", - "format": "date-time", - "type": "string" - }, - "subscriptions": { - "default": 0, - "description": "The number of subscriptions for the server.", - "format": "int64", - "type": "integer" - }, - "system_account": { - "description": "The system account.", - "type": "string" - }, - "tls_timeout": { - "default": 0, - "description": "The TLS timeout of the server.", - "format": "int64", - "type": "integer" - }, - "total_connections": { - "default": 0, - "description": "The total number of connections to the server.", - "format": "int64", - "type": "integer" - }, - "uptime": { - "description": "The uptime of the server.", - "type": "string" - }, - "version": { - "description": "The version of the service.", - "type": "string" - }, - "write_deadline": { - "default": 0, - "description": "The write deadline of the server.", - "format": "int64", - "type": "integer" - } - }, - "required": [ - "config_load_time", - "host", - "http_req_stats", - "id", - "ip", - "now", - "rtt", - "start" - ], - "type": "object" - }, - "CreatedAtSortMode": { - "description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.", - "enum": [ - "created-at-ascending", - "created-at-descending" - ], - "type": "string" - }, - "Currency": { - "description": "Currency is the list of supported currencies.\n\nFor more details see \u003chttps://support.stripe.com/questions/which-currencies-does-stripe-support\u003e.", - "enum": [ - "aed", - "afn", - "all", - "amd", - "ang", - "aoa", - "ars", - "aud", - "awg", - "azn", - "bam", - "bbd", - "bdt", - "bgn", - "bif", - "bmd", - "bnd", - "bob", - "brl", - "bsd", - "bwp", - "bzd", - "cad", - "cdf", - "chf", - "clp", - "cny", - "cop", - "crc", - "cve", - "czk", - "djf", - "dkk", - "dop", - "dzd", - "eek", - "egp", - "etb", - "eur", - "fjd", - "fkp", - "gbp", - "gel", - "gip", - "gmd", - "gnf", - "gtq", - "gyd", - "hkd", - "hnl", - "hrk", - "htg", - "huf", - "idr", - "ils", - "inr", - "isk", - "jmd", - "jpy", - "kes", - "kgs", - "khr", - "kmf", - "krw", - "kyd", - "kzt", - "lak", - "lbp", - "lkr", - "lrd", - "lsl", - "ltl", - "lvl", - "mad", - "mdl", - "mga", - "mkd", - "mnt", - "mop", - "mro", - "mur", - "mvr", - "mwk", - "mxn", - "myr", - "mzn", - "nad", - "ngn", - "nio", - "nok", - "npr", - "nzd", - "pab", - "pen", - "pgk", - "php", - "pkr", - "pln", - "pyg", - "qar", - "ron", - "rsd", - "rub", - "rwf", - "sar", - "sbd", - "scr", - "sek", - "sgd", - "shp", - "sll", - "sos", - "srd", - "std", - "svc", - "szl", - "thb", - "tjs", - "top", - "try", - "ttd", - "twd", - "tzs", - "uah", - "ugx", - "usd", - "uyu", - "uzs", - "vef", - "vnd", - "vuv", - "wst", - "xaf", - "xcd", - "xof", - "xpf", - "yer", - "zar", - "zmw" - ], - "type": "string" - }, - "Customer": { - "description": "The resource representing a payment \"Customer\".", - "properties": { - "address": { - "allOf": [ - { - "$ref": "#/components/schemas/Address" - } - ], - "description": "The customer's address.", - "nullable": true - }, - "balance": { - "default": 0, - "description": "Current balance, if any, being stored on the customer.\n\nIf negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.", - "format": "int64", - "type": "integer" - }, - "created_at": { - "description": "Time at which the object was created.", - "format": "date-time", - "type": "string" - }, - "currency": { - "allOf": [ - { - "$ref": "#/components/schemas/Currency" - } - ], - "description": "Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes." - }, - "delinquent": { - "default": false, - "description": "When the customer's latest invoice is billed by charging automatically, `delinquent` is `true` if the invoice's latest charge failed.\n\nWhen the customer's latest invoice is billed by sending an invoice, `delinquent` is `true` if the invoice isn't paid by its due date. If an invoice is marked uncollectible by dunning, `delinquent` doesn't get reset to `false`.", - "type": "boolean" - }, - "email": { - "description": "The customer's email address.", - "type": "string" - }, - "id": { - "description": "Unique identifier for the object.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "default": {}, - "description": "Set of key-value pairs.", - "type": "object" - }, - "name": { - "description": "The customer's full name or business name.", - "type": "string" - }, - "phone": { - "description": "The customer's phone number.", - "type": "string" - } - }, - "required": [ - "created_at", - "currency" - ], - "type": "object" - }, - "Duration": { - "format": "int64", - "title": "int64", - "type": "integer" - }, - "EngineMetadata": { - "description": "Metadata about an engine API instance.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "async_jobs_running": { - "description": "If any async job is currently running.", - "type": "boolean" - }, - "fs": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSystemMetadata" - } - ], - "description": "Metadata about our file system." - }, - "git_hash": { - "description": "The git hash of the server.", - "type": "string" - }, - "pubsub": { - "allOf": [ - { - "$ref": "#/components/schemas/Connection" - } - ], - "description": "Metadata about our pub-sub connection." - } - }, - "required": [ - "async_jobs_running", - "fs", - "git_hash", - "pubsub" - ], - "type": "object" - }, - "Environment": { - "description": "The environment the server is running in.", - "enum": [ - "DEVELOPMENT", - "PREVIEW", - "PRODUCTION" - ], - "type": "string" - }, - "Error": { - "description": "Error information from a response.", - "properties": { - "error_code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "request_id": { - "type": "string" - } - }, - "required": [ - "message", - "request_id" - ], - "type": "object" - }, - "ExtendedUser": { - "description": "Extended user information.\n\nThis is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp, Stripe, and Zendesk.", - "properties": { - "company": { - "description": "The user's company.", - "type": "string" - }, - "created_at": { - "description": "The date and time the user was created.", - "format": "partial-date-time", - "type": "string" - }, - "discord": { - "description": "The user's Discord handle.", - "type": "string" - }, - "email": { - "description": "The email address of the user.", - "type": "string" - }, - "email_verified": { - "description": "The date and time the email address was verified.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "first_name": { - "description": "The user's first name.", - "type": "string" - }, - "github": { - "description": "The user's GitHub handle.", - "type": "string" - }, - "id": { - "description": "The unique identifier for the user.", - "type": "string" - }, - "image": { - "description": "The image avatar for the user. This is a URL.", - "type": "string" - }, - "last_name": { - "description": "The user's last name.", - "type": "string" - }, - "mailchimp_id": { - "description": "The user's MailChimp ID. This is mostly used for internal mapping.", - "nullable": true, - "type": "string" - }, - "name": { - "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", - "type": "string" - }, - "phone": { - "description": "The user's phone number.", - "type": "string" - }, - "stripe_id": { - "description": "The user's Stripe ID. This is mostly used for internal mapping.", - "nullable": true, - "type": "string" - }, - "updated_at": { - "description": "The date and time the user was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "zendesk_id": { - "description": "The user's Zendesk ID. This is mostly used for internal mapping.", - "nullable": true, - "type": "string" - } - }, - "required": [ - "created_at", - "updated_at" - ], - "type": "object" - }, - "ExtendedUserResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/ExtendedUser" - }, - "type": "array" - }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, - "type": "string" - } - }, - "required": [ - "items" - ], - "type": "object" - }, - "FileConversion": { - "description": "A file conversion.", - "properties": { - "completed_at": { - "description": "The time and date the file conversion was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the file conversion was created.", - "format": "partial-date-time", - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." - }, - "output": { - "description": "The converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors.", - "type": "string" - }, - "output_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileOutputFormat" - } - ], - "description": "The output format of the file conversion." - }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSourceFormat" - } - ], - "description": "The source format of the file conversion." - }, - "started_at": { - "description": "The time and date the file conversion was started.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/APICallStatus" - } - ], - "description": "The status of the file conversion." - }, - "updated_at": { - "description": "The time and date the file conversion was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID of the user who created the file conversion.", - "type": "string" - } - }, - "required": [ - "created_at", - "id", - "output_format", - "src_format", - "status", - "updated_at" - ], - "type": "object" - }, - "FileMass": { - "description": "A file mass result.", - "properties": { - "completed_at": { - "description": "The time and date the mass was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the mass was created.", - "format": "partial-date-time", - "type": "string" - }, - "error": { - "description": "The error the function returned, if any.", - "nullable": true, - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier of the mass request.\n\nThis is the same as the API call ID." - }, - "mass": { - "description": "The resulting mass.", - "format": "float", - "nullable": true, - "type": "number" - }, - "material_density": { - "default": 0, - "description": "The material density as denoted by the user.", - "format": "float", - "type": "number" - }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSourceFormat" - } - ], - "description": "The source format of the file." - }, - "started_at": { - "description": "The time and date the mass was started.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/APICallStatus" - } - ], - "description": "The status of the mass." - }, - "updated_at": { - "description": "The time and date the mass was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID of the user who created the mass.", - "type": "string" - } - }, - "required": [ - "created_at", - "id", - "src_format", - "status", - "updated_at" - ], - "type": "object" - }, - "FileOutputFormat": { - "description": "The valid types of output file formats.", - "enum": [ - "stl", - "obj", - "dae", - "step", - "fbx", - "fbxb" - ], - "type": "string" - }, - "FileSourceFormat": { - "description": "The valid types of source file formats.", - "enum": [ - "stl", - "obj", - "dae", - "step", - "fbx" - ], - "type": "string" - }, - "FileSystemMetadata": { - "description": "Metadata about our file system.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "ok": { - "description": "If the file system passed a sanity check.", - "type": "boolean" - } - }, - "required": [ - "ok" - ], - "type": "object" - }, - "FileVolume": { - "description": "A file volume result.", - "properties": { - "completed_at": { - "description": "The time and date the volume was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the volume was created.", - "format": "partial-date-time", - "type": "string" - }, - "error": { - "description": "The error the function returned, if any.", - "nullable": true, - "type": "string" - }, - "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier of the volume request.\n\nThis is the same as the API call ID." - }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSourceFormat" - } - ], - "description": "The source format of the file." - }, - "started_at": { - "description": "The time and date the volume was started.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/APICallStatus" - } - ], - "description": "The status of the volume." - }, - "updated_at": { - "description": "The time and date the volume was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID of the user who created the volume.", - "type": "string" - }, - "volume": { - "description": "The resulting volume.", - "format": "float", - "nullable": true, - "type": "number" - } - }, - "required": [ - "created_at", - "id", - "src_format", - "status", - "updated_at" - ], - "type": "object" - }, - "Gateway": { - "description": "Gateway information.", - "properties": { - "auth_timeout": { - "default": 0, - "description": "The auth timeout of the gateway.", - "format": "int64", - "type": "integer" - }, - "host": { - "description": "The host of the gateway.", - "type": "string" - }, - "name": { - "description": "The name of the gateway.", - "type": "string" - }, - "port": { - "default": 0, - "description": "The port of the gateway.", - "format": "int64", - "type": "integer" - }, - "tls_timeout": { - "default": 0, - "description": "The TLS timeout for the gateway.", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, - "Invoice": { - "description": "An invoice.", - "properties": { - "amount_due": { - "default": 0, - "description": "Final amount due at this time for this invoice.\n\nIf the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.", - "format": "int64", - "type": "integer" - }, - "amount_paid": { - "default": 0, - "description": "The amount, in %s, that was paid.", - "format": "int64", - "type": "integer" - }, - "amount_remaining": { - "default": 0, - "description": "The amount remaining, in %s, that is due.", - "format": "int64", - "type": "integer" - }, - "attempt_count": { - "default": 0, - "description": "Number of payment attempts made for this invoice, from the perspective of the payment retry schedule.\n\nAny payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.", - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "attempted": { - "default": false, - "description": "Whether an attempt has been made to pay the invoice.\n\nAn invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.", - "type": "boolean" - }, - "created_at": { - "description": "Time at which the object was created.", - "format": "date-time", - "type": "string" - }, - "currency": { - "allOf": [ - { - "$ref": "#/components/schemas/Currency" - } - ], - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase." - }, - "description": { - "description": "Description of the invoice.", - "type": "string" - }, - "id": { - "description": "Unique identifier for the object.", - "type": "string" - }, - "invoice_pdf": { - "description": "The link to download the PDF for the invoice.", - "type": "string" - }, - "invoice_url": { - "description": "The URL for the hosted invoice page, which allows customers to view and pay an invoice.", - "type": "string" - }, - "lines": { - "description": "The individual line items that make up the invoice.\n\n`lines` is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any.", - "items": { - "$ref": "#/components/schemas/InvoiceLineItem" - }, - "type": "array" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "default": {}, - "description": "Set of key-value pairs.", - "type": "object" - }, - "number": { - "description": "A unique, identifying string that appears on emails sent to the customer for this invoice.", - "type": "string" - }, - "paid": { - "default": false, - "description": "Whether payment was successfully collected for this invoice.\n\nAn invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.", - "type": "boolean" - }, - "receipt_number": { - "description": "This is the transaction number that appears on email receipts sent for this invoice.", - "type": "string" - }, - "statement_descriptor": { - "description": "Extra information about an invoice for the customer's credit card statement.", - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/InvoiceStatus" - } - ], - "description": "The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`.\n\n[Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview).", - "nullable": true - }, - "subtotal": { - "default": 0, - "description": "Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied.\n\nItem discounts are already incorporated.", - "format": "int64", - "type": "integer" - }, - "tax": { - "default": 0, - "description": "The amount of tax on this invoice.\n\nThis is the sum of all the tax amounts on this invoice.", - "format": "int64", - "type": "integer" - }, - "total": { - "default": 0, - "description": "Total after discounts and taxes.", - "format": "int64", - "type": "integer" - } - }, - "required": [ - "created_at", - "currency" - ], - "type": "object" - }, - "InvoiceLineItem": { - "description": "An invoice line item.", - "properties": { - "amount": { - "default": 0, - "description": "The amount, in %s.", - "format": "int64", - "type": "integer" - }, - "currency": { - "allOf": [ - { - "$ref": "#/components/schemas/Currency" - } - ], - "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase." - }, - "description": { - "description": "The description.", - "type": "string" - }, - "id": { - "description": "Unique identifier for the object.", - "type": "string" - }, - "invoice_item": { - "description": "The ID of the invoice item associated with this line item if any.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "default": {}, - "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.\n\nSet of key-value pairs.", - "type": "object" - } - }, - "required": [ - "currency" - ], - "type": "object" - }, - "InvoiceStatus": { - "description": "An enum representing the possible values of an `Invoice`'s `status` field.", - "enum": [ - "deleted", - "draft", - "open", - "paid", - "uncollectible", - "void" - ], - "type": "string" - }, - "Jetstream": { - "description": "Jetstream information.", - "properties": { - "config": { - "allOf": [ - { - "$ref": "#/components/schemas/JetstreamConfig" - } - ], - "default": { - "max_memory": 0, - "max_storage": 0 - }, - "description": "The Jetstream config." - }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/MetaClusterInfo" - } - ], - "default": { - "cluster_size": 0 - }, - "description": "Meta information about the cluster." - }, - "stats": { - "allOf": [ - { - "$ref": "#/components/schemas/JetstreamStats" - } - ], - "default": { - "accounts": 0, - "api": { - "errors": 0, - "inflight": 0, - "total": 0 - }, - "ha_assets": 0, - "memory": 0, - "reserved_memory": 0, - "reserved_store": 0, - "store": 0 - }, - "description": "Jetstream statistics." - } - }, - "type": "object" - }, - "JetstreamApiStats": { - "description": "Jetstream API statistics.", - "properties": { - "errors": { - "default": 0, - "description": "The number of errors.", - "format": "int64", - "type": "integer" - }, - "inflight": { - "default": 0, - "description": "The number of inflight requests.", - "format": "int64", - "type": "integer" - }, - "total": { - "default": 0, - "description": "The number of requests.", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, - "JetstreamConfig": { - "description": "Jetstream configuration.", - "properties": { - "domain": { - "description": "The domain.", - "type": "string" - }, - "max_memory": { - "default": 0, - "description": "The max memory.", - "format": "int64", - "type": "integer" - }, - "max_storage": { - "default": 0, - "description": "The max storage.", - "format": "int64", - "type": "integer" - }, - "store_dir": { - "description": "The store directory.", - "type": "string" - } - }, - "type": "object" - }, - "JetstreamStats": { - "description": "Jetstream statistics.", - "properties": { - "accounts": { - "default": 0, - "description": "The number of accounts.", - "format": "int64", - "type": "integer" - }, - "api": { - "allOf": [ - { - "$ref": "#/components/schemas/JetstreamApiStats" - } - ], - "default": { - "errors": 0, - "inflight": 0, - "total": 0 - }, - "description": "API stats." - }, - "ha_assets": { - "default": 0, - "description": "The number of HA assets.", - "format": "int64", - "type": "integer" - }, - "memory": { - "default": 0, - "description": "The memory used by the Jetstream server.", - "format": "int64", - "type": "integer" - }, - "reserved_memory": { - "default": 0, - "description": "The reserved memory for the Jetstream server.", - "format": "int64", - "type": "integer" - }, - "reserved_store": { - "default": 0, - "description": "The reserved storage for the Jetstream server.", - "format": "int64", - "type": "integer" - }, - "store": { - "default": 0, - "description": "The storage used by the Jetstream server.", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, - "LeafNode": { - "description": "Leaf node information.", - "properties": { - "auth_timeout": { - "default": 0, - "description": "The auth timeout of the leaf node.", - "format": "int64", - "type": "integer" - }, - "host": { - "description": "The host of the leaf node.", - "type": "string" - }, - "port": { - "default": 0, - "description": "The port of the leaf node.", - "format": "int64", - "type": "integer" - }, - "tls_timeout": { - "default": 0, - "description": "The TLS timeout for the leaf node.", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, - "LoginParams": { - "description": "The parameters passed to login.", - "properties": { - "session": { - "description": "The session token we should set as a cookie.", - "type": "string" - } - }, - "required": [ - "session" - ], - "type": "object" - }, - "MetaClusterInfo": { - "description": "Jetstream statistics.", - "properties": { - "cluster_size": { - "default": 0, - "description": "The size of the cluster.", - "format": "int64", - "type": "integer" - }, - "leader": { - "description": "The leader of the cluster.", - "type": "string" - }, - "name": { - "description": "The name of the cluster.", - "type": "string" - } - }, - "type": "object" - }, - "Metadata": { - "description": "Metadata about our currently running server.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "cache": { - "allOf": [ - { - "$ref": "#/components/schemas/CacheMetadata" - } - ], - "description": "Metadata about our cache." - }, - "engine": { - "allOf": [ - { - "$ref": "#/components/schemas/EngineMetadata" - } - ], - "description": "Metadata about our engine API connection." - }, - "environment": { - "allOf": [ - { - "$ref": "#/components/schemas/Environment" - } - ], - "description": "The environment we are running in." - }, - "fs": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSystemMetadata" - } - ], - "description": "Metadata about our file system." - }, - "git_hash": { - "description": "The git hash of the server.", - "type": "string" - }, - "pubsub": { - "allOf": [ - { - "$ref": "#/components/schemas/Connection" - } - ], - "description": "Metadata about our pub-sub connection." - } - }, - "required": [ - "cache", - "engine", - "environment", - "fs", - "git_hash", - "pubsub" - ], - "type": "object" - }, - "Method": { - "description": "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions.", - "enum": [ - "OPTIONS", - "GET", - "POST", - "PUT", - "DELETE", - "HEAD", - "TRACE", - "CONNECT", - "PATCH", - "EXTENSION" - ], - "type": "string" - }, - "PaymentIntent": { - "description": "A payment intent response.", - "properties": { - "client_secret": { - "description": "The client secret is used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.", - "type": "string" - } - }, - "required": [ - "client_secret" - ], - "type": "object" - }, - "PaymentMethod": { - "description": "A payment method.", - "properties": { - "billing_info": { - "allOf": [ - { - "$ref": "#/components/schemas/BillingInfo" - } - ], - "description": "The billing info for the payment method." - }, - "card": { - "allOf": [ - { - "$ref": "#/components/schemas/CardDetails" - } - ], - "description": "The card, if it is one. For our purposes, this is the only type of payment method that we support.", - "nullable": true - }, - "created_at": { - "description": "Time at which the object was created.", - "format": "date-time", - "type": "string" - }, - "id": { - "description": "Unique identifier for the object.", - "type": "string" - }, - "metadata": { - "additionalProperties": { - "type": "string" - }, - "default": {}, - "description": "Set of key-value pairs.", - "type": "object" - }, - "type": { - "allOf": [ - { - "$ref": "#/components/schemas/PaymentMethodType" - } - ], - "description": "The type of payment method." - } - }, - "required": [ - "billing_info", - "created_at", - "type" - ], - "type": "object" - }, - "PaymentMethodCardChecks": { - "description": "Card checks.", - "properties": { - "address_line1_check": { - "description": "If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "type": "string" - }, - "address_postal_code_check": { - "description": "If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "type": "string" - }, - "cvc_check": { - "description": "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "type": "string" - } - }, - "type": "object" - }, - "PaymentMethodType": { - "description": "An enum representing the possible values of an `PaymentMethod`'s `type` field.", - "enum": [ - "card" - ], - "type": "string" - }, - "Pong": { - "description": "The response from the `/ping` endpoint.", - "properties": { - "message": { - "description": "The pong response.", - "type": "string" - } - }, - "required": [ - "message" - ], - "type": "object" - }, - "Session": { - "description": "An authentication session.\n\nFor our UIs, these are automatically created by Next.js.", - "properties": { - "created_at": { - "description": "The date and time the session was created.", - "format": "partial-date-time", - "type": "string" - }, - "expires": { - "description": "The date and time the session expires.", - "format": "partial-date-time", - "type": "string" - }, - "id": { - "description": "The unique identifier for the session.", - "type": "string" - }, - "session_token": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The session token." - }, - "updated_at": { - "description": "The date and time the session was last updated.", - "format": "partial-date-time", - "type": "string" - }, - "user_id": { - "description": "The user ID of the user that the session belongs to.", - "type": "string" - } - }, - "required": [ - "created_at", - "expires", - "session_token", - "updated_at" - ], - "type": "object" - }, - "StatusCode": { - "format": "int32", - "title": "int32", - "type": "integer" - }, - "UpdateUser": { - "description": "The user-modifiable parts of a User.", - "properties": { - "company": { - "description": "The user's company.", - "type": "string" - }, - "discord": { - "description": "The user's Discord handle.", - "type": "string" - }, - "first_name": { - "description": "The user's first name.", - "type": "string" - }, - "github": { - "description": "The user's GitHub handle.", - "type": "string" - }, - "last_name": { - "description": "The user's last name.", - "type": "string" - }, - "phone": { - "description": "The user's phone number.", - "type": "string" - } - }, - "type": "object" - }, - "User": { - "description": "A user.", - "properties": { - "company": { - "description": "The user's company.", - "type": "string" - }, - "created_at": { - "description": "The date and time the user was created.", - "format": "partial-date-time", - "type": "string" - }, - "discord": { - "description": "The user's Discord handle.", - "type": "string" - }, - "email": { - "description": "The email address of the user.", - "type": "string" - }, - "email_verified": { - "description": "The date and time the email address was verified.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "first_name": { - "description": "The user's first name.", - "type": "string" - }, - "github": { - "description": "The user's GitHub handle.", - "type": "string" - }, - "id": { - "description": "The unique identifier for the user.", - "type": "string" - }, - "image": { - "description": "The image avatar for the user. This is a URL.", - "type": "string" - }, - "last_name": { - "description": "The user's last name.", - "type": "string" - }, - "name": { - "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", - "type": "string" - }, - "phone": { - "description": "The user's phone number.", - "type": "string" - }, - "updated_at": { - "description": "The date and time the user was last updated.", - "format": "partial-date-time", - "type": "string" - } - }, - "required": [ - "created_at", - "updated_at" - ], - "type": "object" - }, - "UserResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/User" - }, - "type": "array" - }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, - "type": "string" - } - }, - "required": [ - "items" - ], - "type": "object" - }, - "Uuid": { - "description": "A uuid.\n\nA Version 4 UUID is a universally unique identifier that is generated using random numbers.", - "format": "uuid", - "type": "string" - } - } - }, - "info": { - "contact": { - "email": "api@kittycad.io", - "url": "https://kittycad.io" - }, - "description": "API server for KittyCAD", - "title": "KittyCAD API", - "version": "0.1.0", - "x-go": { - "client": "// Create a client with your token.\nclient, err := kittycad.NewClient(\"$TOKEN\", \"your apps user agent\")\nif err != nil {\n panic(err)\n}\n\n// - OR -\n\n// Create a new client with your token parsed from the environment\n// variable: KITTYCAD_API_TOKEN.\nclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\nif err != nil {\n panic(err)\n}", - "install": "go get github.com/kittycad/kittycad.go" - } - }, - "openapi": "3.0.3", - "paths": { - "/": { - "get": { - "operationId": "get_schema", - "responses": { - "200": { - "content": { - "application/json": { - "schema": {} - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" + "EngineMetadata": { + "description": "Metadata about an engine API instance.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "async_jobs_running": { + "description": "If any async job is currently running.", + "type": "boolean" + }, + "fs": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemMetadata", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata" + ] + } + ], + "description": "Metadata about our file system." + }, + "git_hash": { + "description": "The git hash of the server.", + "type": "string" + }, + "pubsub": { + "allOf": [ + { + "$ref": "#/components/schemas/Connection", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata" + ] + } + ], + "description": "Metadata about our pub-sub connection." + } }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get OpenAPI schema.", - "tags": [ - "meta" - ], - "x-go": { - "example": "// GetSchema: Get OpenAPI schema.\nresponseGetSchema, err := client.Meta.GetSchema()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.GetSchema" - } - } - }, - "/_meta/info": { - "get": { - "description": "This includes information on any of our other distributed systems it is connected to.\nYou must be a KittyCAD employee to perform this request.", - "operationId": "get_metadata", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Metadata" - } - } + "required": [ + "async_jobs_running", + "fs", + "git_hash", + "pubsub" + ], + "type": "object" }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get the metadata about our currently running server.", - "tags": [ - "meta" - ], - "x-go": { - "example": "// Getdata: Get the metadata about our currently running server.\n//\n// This includes information on any of our other distributed systems it is connected to.\n// You must be a KittyCAD employee to perform this request.\nmetadata, err := client.Meta.Getdata()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Getdata" - } - } - }, - "/api-call-metrics": { - "get": { - "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.", - "operationId": "get_api_call_metrics", - "parameters": [ - { - "description": "What field to group the metrics by.", - "in": "query", - "name": "group_by", - "required": true, - "schema": { - "$ref": "#/components/schemas/ApiCallQueryGroupBy" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/ApiCallQueryGroup" - }, - "title": "Array_of_ApiCallQueryGroup", - "type": "array" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get API call metrics.", - "tags": [ - "api-calls" - ], - "x-go": { - "example": "// GetMetrics: Get API call metrics.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.\n//\n// Parameters:\n//\t- `groupBy`: What field to group the metrics by.\nAPICallQueryGroup, err := client.APICall.GetMetrics(groupBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetMetrics" - } - } - }, - "/api-calls": { - "get": { - "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.", - "operationId": "list_api_calls", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retrieve the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List API calls.", - "tags": [ - "api-calls" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// List: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.List" - } - } - }, - "/api-calls/{id}": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\nIf the user is not authenticated to view the specified API call, then it is not returned.\nOnly KittyCAD employees can view API calls for other users.", - "operationId": "get_api_call", - "parameters": [ - { - "description": "The ID of the API call.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPrice" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get details of an API call.", - "tags": [ - "api-calls" - ], - "x-go": { - "example": "// Get: Get details of an API call.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n// If the user is not authenticated to view the specified API call, then it is not returned.\n// Only KittyCAD employees can view API calls for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.Get(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.Get" - } - } - }, - "/async/operations/{id}": { - "get": { - "description": "Get the status and output of an async operation.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.\nIf the user is not authenticated to view the specified async operation, then it is not returned.\nOnly KittyCAD employees with the proper access can view async operations for other users.", - "operationId": "get_async_operation", - "parameters": [ - { - "description": "The ID of the async operation.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AsyncApiCallOutput" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get an async operation.", - "tags": [ - "api-calls" - ], - "x-go": { - "example": "// GetAsyncOperation: Get an async operation.\n//\n// Get the status and output of an async operation.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.\n// If the user is not authenticated to view the specified async operation, then it is not returned.\n// Only KittyCAD employees with the proper access can view async operations for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.APICall.GetAsyncOperation(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetAsyncOperation" - } - } - }, - "/file/conversion/{src_format}/{output_format}": { - "post": { - "description": "Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\nIf the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nIf 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.", - "operationId": "create_file_conversion", - "parameters": [ - { - "description": "The format the file should be converted to.", - "in": "path", - "name": "output_format", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileOutputFormat" - }, - "style": "simple" - }, - { - "description": "The format of the file to convert.", - "in": "path", - "name": "src_format", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileSourceFormat" - }, - "style": "simple" - } - ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", + "Environment": { + "description": "The environment the server is running in.", + "enum": [ + "DEVELOPMENT", + "PREVIEW", + "PRODUCTION" + ], "type": "string" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileConversion" - } - } }, - "description": "successful creation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" + "Error": { + "description": "Error information from a response.", + "properties": { + "error_code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "request_id": { + "type": "string" + } }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Convert CAD file.", - "tags": [ - "file" - ], - "x-go": { - "example": "// CreateConversion: Convert CAD file.\n//\n// Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\n// If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// 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.\n//\n// Parameters:\n//\t- `outputFormat`: The format the file should be converted to.\n//\t- `srcFormat`: The format of the file to convert.\nfileConversion, err := client.File.CreateConversion(outputFormat, srcFormat, body)\n\n// - OR -\n\n// CreateConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the CreateConversion function.\nfileConversion, err := client.File.CreateConversionWithBase64Helper(outputFormat, srcFormat, body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateConversion" - } - } - }, - "/file/conversions/{id}": { - "get": { - "description": "Get the status and output of an async file conversion.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\nIf the user is not authenticated to view the specified file conversion, then it is not returned.\nOnly KittyCAD employees with the proper access can view file conversions for other users.", - "operationId": "get_file_conversion", - "parameters": [ - { - "description": "The ID of the async operation.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" + "required": [ + "message", + "request_id" + ], + "type": "object" }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AsyncApiCallOutput" - } - } + "ExtendedUser": { + "description": "Extended user information.\n\nThis is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp, Stripe, and Zendesk.", + "properties": { + "company": { + "description": "The user's company.", + "type": "string" + }, + "created_at": { + "description": "The date and time the user was created.", + "format": "partial-date-time", + "type": "string" + }, + "discord": { + "description": "The user's Discord handle.", + "type": "string" + }, + "email": { + "description": "The email address of the user.", + "type": "string" + }, + "email_verified": { + "description": "The date and time the email address was verified.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "first_name": { + "description": "The user's first name.", + "type": "string" + }, + "github": { + "description": "The user's GitHub handle.", + "type": "string" + }, + "id": { + "description": "The unique identifier for the user.", + "type": "string" + }, + "image": { + "description": "The image avatar for the user. This is a URL.", + "type": "string" + }, + "last_name": { + "description": "The user's last name.", + "type": "string" + }, + "mailchimp_id": { + "description": "The user's MailChimp ID. This is mostly used for internal mapping.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", + "type": "string" + }, + "phone": { + "description": "The user's phone number.", + "type": "string" + }, + "stripe_id": { + "description": "The user's Stripe ID. This is mostly used for internal mapping.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time the user was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "zendesk_id": { + "description": "The user's Zendesk ID. This is mostly used for internal mapping.", + "nullable": true, + "type": "string" + } + }, + "required": [ + "created_at", + "updated_at" + ], + "type": "object" }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" + "ExtendedUserResultsPage": { + "description": "A single page of results", + "properties": { + "items": { + "description": "list of items on this page of results", + "items": { + "$ref": "#/components/schemas/ExtendedUser", + "x-scope": [ + "", + "#/components/schemas/ExtendedUserResultsPage" + ] + }, + "type": "array" + }, + "next_page": { + "description": "token used to fetch the next page of results (if any)", + "nullable": true, + "type": "string" + } }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get a file conversion.", - "tags": [ - "file" - ], - "x-go": { - "example": "// GetConversion: Get a file conversion.\n//\n// Get the status and output of an async file conversion.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n// If the user is not authenticated to view the specified file conversion, then it is not returned.\n// Only KittyCAD employees with the proper access can view file conversions for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.File.GetConversion(id)\n\n// - OR -\n\n// GetConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the GetConversion function.\nasyncAPICallOutput, err := client.File.GetConversionWithBase64Helper(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversion" - } - } - }, - "/file/execute/{lang}": { - "post": { - "operationId": "create_file_execution", - "parameters": [ - { - "description": "The language of the code.", - "in": "path", - "name": "lang", - "required": true, - "schema": { - "$ref": "#/components/schemas/CodeLanguage" + "required": [ + "items" + ], + "type": "object" }, - "style": "simple" - }, - { - "description": "The output file we want to get the contents for (this is relative to where in litterbox it is being run).", - "in": "query", - "name": "output", - "schema": { - "nullable": true, - "type": "string" + "FileConversion": { + "description": "A file conversion.", + "properties": { + "completed_at": { + "description": "The time and date the file conversion was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the file conversion was created.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileConversion" + ] + } + ], + "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." + }, + "output": { + "description": "The converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors.", + "type": "string" + }, + "output_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileOutputFormat", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileConversion" + ] + } + ], + "description": "The output format of the file conversion." + }, + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileConversion" + ] + } + ], + "description": "The source format of the file conversion." + }, + "started_at": { + "description": "The time and date the file conversion was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileConversion" + ] + } + ], + "description": "The status of the file conversion." + }, + "updated_at": { + "description": "The time and date the file conversion was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the file conversion.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "output_format", + "src_format", + "status", + "updated_at" + ], + "type": "object" }, - "style": "form" - } - ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", + "FileMass": { + "description": "A file mass result.", + "properties": { + "completed_at": { + "description": "The time and date the mass was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the mass was created.", + "format": "partial-date-time", + "type": "string" + }, + "error": { + "description": "The error the function returned, if any.", + "nullable": true, + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileMass" + ] + } + ], + "description": "The unique identifier of the mass request.\n\nThis is the same as the API call ID." + }, + "mass": { + "description": "The resulting mass.", + "format": "float", + "nullable": true, + "type": "number" + }, + "material_density": { + "default": 0, + "description": "The material density as denoted by the user.", + "format": "float", + "type": "number" + }, + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileMass" + ] + } + ], + "description": "The source format of the file." + }, + "started_at": { + "description": "The time and date the mass was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileMass" + ] + } + ], + "description": "The status of the mass." + }, + "updated_at": { + "description": "The time and date the mass was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the mass.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "src_format", + "status", + "updated_at" + ], + "type": "object" + }, + "FileOutputFormat": { + "description": "The valid types of output file formats.", + "enum": [ + "stl", + "obj", + "dae", + "step", + "fbx", + "fbxb" + ], "type": "string" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CodeOutput" - } - } }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Execute a KittyCAD program in a specific language.", - "tags": [ - "file" - ], - "x-go": { - "example": "// CreateExecution: Execute a KittyCAD program in a specific language.\n//\n// Parameters:\n//\t- `lang`: The language of the code.\n//\t- `output`: The output file we want to get the contents for (this is relative to where in litterbox it is being run).\ncodeOutput, err := client.File.CreateExecution(lang, output, body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateExecution" - } - } - }, - "/file/mass": { - "post": { - "description": "Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\nIf 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.", - "operationId": "create_file_mass", - "parameters": [ - { - "description": "The material density.", - "in": "query", - "name": "material_density", - "required": true, - "schema": { - "format": "float", - "type": "number" - }, - "style": "form" - }, - { - "description": "The format of the file.", - "in": "query", - "name": "src_format", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileSourceFormat" - }, - "style": "form" - } - ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", + "FileSourceFormat": { + "description": "The valid types of source file formats.", + "enum": [ + "stl", + "obj", + "dae", + "step", + "fbx" + ], "type": "string" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileMass" - } - } }, - "description": "successful creation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" + "FileSystemMetadata": { + "description": "Metadata about our file system.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "ok": { + "description": "If the file system passed a sanity check.", + "type": "boolean" + } }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get CAD file mass.", - "tags": [ - "file", - "beta" - ], - "x-go": { - "example": "// CreateMass: Get CAD file mass.\n//\n// Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\n// 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.\n//\n// Parameters:\n//\t- `materialDensity`: The material density.\n//\t- `srcFormat`: The format of the file.\nfileMass, err := client.File.CreateMass(materialDensity, srcFormat, body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateMass" - } - } - }, - "/file/volume": { - "post": { - "description": "Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\nIf 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.", - "operationId": "create_file_volume", - "parameters": [ - { - "description": "The format of the file.", - "in": "query", - "name": "src_format", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileSourceFormat" + "required": [ + "ok" + ], + "type": "object" }, - "style": "form" - } - ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", + "FileVolume": { + "description": "A file volume result.", + "properties": { + "completed_at": { + "description": "The time and date the volume was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the volume was created.", + "format": "partial-date-time", + "type": "string" + }, + "error": { + "description": "The error the function returned, if any.", + "nullable": true, + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileVolume" + ] + } + ], + "description": "The unique identifier of the volume request.\n\nThis is the same as the API call ID." + }, + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileVolume" + ] + } + ], + "description": "The source format of the file." + }, + "started_at": { + "description": "The time and date the volume was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus", + "x-scope": [ + "", + "#/components/schemas/AsyncApiCallOutput", + "#/components/schemas/FileVolume" + ] + } + ], + "description": "The status of the volume." + }, + "updated_at": { + "description": "The time and date the volume was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the volume.", + "type": "string" + }, + "volume": { + "description": "The resulting volume.", + "format": "float", + "nullable": true, + "type": "number" + } + }, + "required": [ + "created_at", + "id", + "src_format", + "status", + "updated_at" + ], + "type": "object" + }, + "Gateway": { + "description": "Gateway information.", + "properties": { + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the gateway.", + "format": "int64", + "type": "integer" + }, + "host": { + "description": "The host of the gateway.", + "type": "string" + }, + "name": { + "description": "The name of the gateway.", + "type": "string" + }, + "port": { + "default": 0, + "description": "The port of the gateway.", + "format": "int64", + "type": "integer" + }, + "tls_timeout": { + "default": 0, + "description": "The TLS timeout for the gateway.", + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, + "Invoice": { + "description": "An invoice.", + "properties": { + "amount_due": { + "default": 0, + "description": "Final amount due at this time for this invoice.\n\nIf the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.", + "format": "int64", + "type": "integer" + }, + "amount_paid": { + "default": 0, + "description": "The amount, in %s, that was paid.", + "format": "int64", + "type": "integer" + }, + "amount_remaining": { + "default": 0, + "description": "The amount remaining, in %s, that is due.", + "format": "int64", + "type": "integer" + }, + "attempt_count": { + "default": 0, + "description": "Number of payment attempts made for this invoice, from the perspective of the payment retry schedule.\n\nAny payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.", + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "attempted": { + "default": false, + "description": "Whether an attempt has been made to pay the invoice.\n\nAn invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.", + "type": "boolean" + }, + "created_at": { + "description": "Time at which the object was created.", + "format": "date-time", + "type": "string" + }, + "currency": { + "allOf": [ + { + "$ref": "#/components/schemas/Currency", + "x-scope": [ + "", + "#/components/schemas/Invoice" + ] + } + ], + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase." + }, + "description": { + "description": "Description of the invoice.", + "type": "string" + }, + "id": { + "description": "Unique identifier for the object.", + "type": "string" + }, + "invoice_pdf": { + "description": "The link to download the PDF for the invoice.", + "type": "string" + }, + "invoice_url": { + "description": "The URL for the hosted invoice page, which allows customers to view and pay an invoice.", + "type": "string" + }, + "lines": { + "description": "The individual line items that make up the invoice.\n\n`lines` is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any.", + "items": { + "$ref": "#/components/schemas/InvoiceLineItem", + "x-scope": [ + "", + "#/components/schemas/Invoice" + ] + }, + "type": "array" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of key-value pairs.", + "type": "object" + }, + "number": { + "description": "A unique, identifying string that appears on emails sent to the customer for this invoice.", + "type": "string" + }, + "paid": { + "default": false, + "description": "Whether payment was successfully collected for this invoice.\n\nAn invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.", + "type": "boolean" + }, + "receipt_number": { + "description": "This is the transaction number that appears on email receipts sent for this invoice.", + "type": "string" + }, + "statement_descriptor": { + "description": "Extra information about an invoice for the customer's credit card statement.", + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/InvoiceStatus", + "x-scope": [ + "", + "#/components/schemas/Invoice" + ] + } + ], + "description": "The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`.\n\n[Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview).", + "nullable": true + }, + "subtotal": { + "default": 0, + "description": "Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied.\n\nItem discounts are already incorporated.", + "format": "int64", + "type": "integer" + }, + "tax": { + "default": 0, + "description": "The amount of tax on this invoice.\n\nThis is the sum of all the tax amounts on this invoice.", + "format": "int64", + "type": "integer" + }, + "total": { + "default": 0, + "description": "Total after discounts and taxes.", + "format": "int64", + "type": "integer" + } + }, + "required": [ + "created_at", + "currency" + ], + "type": "object" + }, + "InvoiceLineItem": { + "description": "An invoice line item.", + "properties": { + "amount": { + "default": 0, + "description": "The amount, in %s.", + "format": "int64", + "type": "integer" + }, + "currency": { + "allOf": [ + { + "$ref": "#/components/schemas/Currency", + "x-scope": [ + "", + "#/components/schemas/Invoice", + "#/components/schemas/InvoiceLineItem" + ] + } + ], + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase." + }, + "description": { + "description": "The description.", + "type": "string" + }, + "id": { + "description": "Unique identifier for the object.", + "type": "string" + }, + "invoice_item": { + "description": "The ID of the invoice item associated with this line item if any.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.\n\nSet of key-value pairs.", + "type": "object" + } + }, + "required": [ + "currency" + ], + "type": "object" + }, + "InvoiceStatus": { + "description": "An enum representing the possible values of an `Invoice`'s `status` field.", + "enum": [ + "deleted", + "draft", + "open", + "paid", + "uncollectible", + "void" + ], "type": "string" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileVolume" - } - } }, - "description": "successful creation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" + "Jetstream": { + "description": "Jetstream information.", + "properties": { + "config": { + "allOf": [ + { + "$ref": "#/components/schemas/JetstreamConfig", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection", + "#/components/schemas/Jetstream" + ] + } + ], + "default": { + "max_memory": 0, + "max_storage": 0 + }, + "description": "The Jetstream config." + }, + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/MetaClusterInfo", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection", + "#/components/schemas/Jetstream" + ] + } + ], + "default": { + "cluster_size": 0 + }, + "description": "Meta information about the cluster." + }, + "stats": { + "allOf": [ + { + "$ref": "#/components/schemas/JetstreamStats", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection", + "#/components/schemas/Jetstream" + ] + } + ], + "default": { + "accounts": 0, + "api": { + "errors": 0, + "inflight": 0, + "total": 0 + }, + "ha_assets": 0, + "memory": 0, + "reserved_memory": 0, + "reserved_store": 0, + "store": 0 + }, + "description": "Jetstream statistics." + } }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" + "type": "object" + }, + "JetstreamApiStats": { + "description": "Jetstream API statistics.", + "properties": { + "errors": { + "default": 0, + "description": "The number of errors.", + "format": "int64", + "type": "integer" + }, + "inflight": { + "default": 0, + "description": "The number of inflight requests.", + "format": "int64", + "type": "integer" + }, + "total": { + "default": 0, + "description": "The number of requests.", + "format": "int64", + "type": "integer" + } }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" + "type": "object" + }, + "JetstreamConfig": { + "description": "Jetstream configuration.", + "properties": { + "domain": { + "description": "The domain.", + "type": "string" + }, + "max_memory": { + "default": 0, + "description": "The max memory.", + "format": "int64", + "type": "integer" + }, + "max_storage": { + "default": 0, + "description": "The max storage.", + "format": "int64", + "type": "integer" + }, + "store_dir": { + "description": "The store directory.", + "type": "string" + } }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" + "type": "object" + }, + "JetstreamStats": { + "description": "Jetstream statistics.", + "properties": { + "accounts": { + "default": 0, + "description": "The number of accounts.", + "format": "int64", + "type": "integer" + }, + "api": { + "allOf": [ + { + "$ref": "#/components/schemas/JetstreamApiStats", + "x-scope": [ + "", + "#/components/schemas/Metadata", + "#/components/schemas/EngineMetadata", + "#/components/schemas/Connection", + "#/components/schemas/Jetstream", + "#/components/schemas/JetstreamStats" + ] + } + ], + "default": { + "errors": 0, + "inflight": 0, + "total": 0 + }, + "description": "API stats." + }, + "ha_assets": { + "default": 0, + "description": "The number of HA assets.", + "format": "int64", + "type": "integer" + }, + "memory": { + "default": 0, + "description": "The memory used by the Jetstream server.", + "format": "int64", + "type": "integer" + }, + "reserved_memory": { + "default": 0, + "description": "The reserved memory for the Jetstream server.", + "format": "int64", + "type": "integer" + }, + "reserved_store": { + "default": 0, + "description": "The reserved storage for the Jetstream server.", + "format": "int64", + "type": "integer" + }, + "store": { + "default": 0, + "description": "The storage used by the Jetstream server.", + "format": "int64", + "type": "integer" + } }, - "style": "simple" - } + "type": "object" + }, + "LeafNode": { + "description": "Leaf node information.", + "properties": { + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the leaf node.", + "format": "int64", + "type": "integer" + }, + "host": { + "description": "The host of the leaf node.", + "type": "string" + }, + "port": { + "default": 0, + "description": "The port of the leaf node.", + "format": "int64", + "type": "integer" + }, + "tls_timeout": { + "default": 0, + "description": "The TLS timeout for the leaf node.", + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, + "LoginParams": { + "description": "The parameters passed to login.", + "properties": { + "session": { + "description": "The session token we should set as a cookie.", + "type": "string" + } + }, + "required": [ + "session" + ], + "type": "object" + }, + "MetaClusterInfo": { + "description": "Jetstream statistics.", + "properties": { + "cluster_size": { + "default": 0, + "description": "The size of the cluster.", + "format": "int64", + "type": "integer" + }, + "leader": { + "description": "The leader of the cluster.", + "type": "string" + }, + "name": { + "description": "The name of the cluster.", + "type": "string" + } + }, + "type": "object" + }, + "Metadata": { + "description": "Metadata about our currently running server.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "cache": { + "allOf": [ + { + "$ref": "#/components/schemas/CacheMetadata", + "x-scope": [ + "", + "#/components/schemas/Metadata" + ] + } + ], + "description": "Metadata about our cache." + }, + "engine": { + "allOf": [ + { + "$ref": "#/components/schemas/EngineMetadata", + "x-scope": [ + "", + "#/components/schemas/Metadata" + ] + } + ], + "description": "Metadata about our engine API connection." + }, + "environment": { + "allOf": [ + { + "$ref": "#/components/schemas/Environment", + "x-scope": [ + "", + "#/components/schemas/Metadata" + ] + } + ], + "description": "The environment we are running in." + }, + "fs": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemMetadata", + "x-scope": [ + "", + "#/components/schemas/Metadata" + ] + } + ], + "description": "Metadata about our file system." + }, + "git_hash": { + "description": "The git hash of the server.", + "type": "string" + }, + "pubsub": { + "allOf": [ + { + "$ref": "#/components/schemas/Connection", + "x-scope": [ + "", + "#/components/schemas/Metadata" + ] + } + ], + "description": "Metadata about our pub-sub connection." + } + }, + "required": [ + "cache", + "engine", + "environment", + "fs", + "git_hash", + "pubsub" + ], + "type": "object" + }, + "Method": { + "description": "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions.", + "enum": [ + "OPTIONS", + "GET", + "POST", + "PUT", + "DELETE", + "HEAD", + "TRACE", + "CONNECT", + "PATCH", + "EXTENSION" + ], + "type": "string" + }, + "PaymentIntent": { + "description": "A payment intent response.", + "properties": { + "client_secret": { + "description": "The client secret is used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.", + "type": "string" + } + }, + "required": [ + "client_secret" + ], + "type": "object" + }, + "PaymentMethod": { + "description": "A payment method.", + "properties": { + "billing_info": { + "allOf": [ + { + "$ref": "#/components/schemas/BillingInfo", + "x-scope": [ + "", + "#/components/schemas/PaymentMethod" + ] + } + ], + "description": "The billing info for the payment method." + }, + "card": { + "allOf": [ + { + "$ref": "#/components/schemas/CardDetails", + "x-scope": [ + "", + "#/components/schemas/PaymentMethod" + ] + } + ], + "description": "The card, if it is one. For our purposes, this is the only type of payment method that we support.", + "nullable": true + }, + "created_at": { + "description": "Time at which the object was created.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "Unique identifier for the object.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of key-value pairs.", + "type": "object" + }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/PaymentMethodType", + "x-scope": [ + "", + "#/components/schemas/PaymentMethod" + ] + } + ], + "description": "The type of payment method." + } + }, + "required": [ + "billing_info", + "created_at", + "type" + ], + "type": "object" + }, + "PaymentMethodCardChecks": { + "description": "Card checks.", + "properties": { + "address_line1_check": { + "description": "If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", + "type": "string" + }, + "address_postal_code_check": { + "description": "If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", + "type": "string" + }, + "cvc_check": { + "description": "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", + "type": "string" + } + }, + "type": "object" + }, + "PaymentMethodType": { + "description": "An enum representing the possible values of an `PaymentMethod`'s `type` field.", + "enum": [ + "card" + ], + "type": "string" + }, + "Pong": { + "description": "The response from the `/ping` endpoint.", + "properties": { + "message": { + "description": "The pong response.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "Session": { + "description": "An authentication session.\n\nFor our UIs, these are automatically created by Next.js.", + "properties": { + "created_at": { + "description": "The date and time the session was created.", + "format": "partial-date-time", + "type": "string" + }, + "expires": { + "description": "The date and time the session expires.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "description": "The unique identifier for the session.", + "type": "string" + }, + "session_token": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid", + "x-scope": [ + "", + "#/components/schemas/Session" + ] + } + ], + "description": "The session token." + }, + "updated_at": { + "description": "The date and time the session was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user that the session belongs to.", + "type": "string" + } + }, + "required": [ + "created_at", + "expires", + "session_token", + "updated_at" + ], + "type": "object" + }, + "StatusCode": { + "format": "int32", + "title": "int32", + "type": "integer" + }, + "UpdateUser": { + "description": "The user-modifiable parts of a User.", + "properties": { + "company": { + "description": "The user's company.", + "type": "string" + }, + "discord": { + "description": "The user's Discord handle.", + "type": "string" + }, + "first_name": { + "description": "The user's first name.", + "type": "string" + }, + "github": { + "description": "The user's GitHub handle.", + "type": "string" + }, + "last_name": { + "description": "The user's last name.", + "type": "string" + }, + "phone": { + "description": "The user's phone number.", + "type": "string" + } + }, + "type": "object" + }, + "User": { + "description": "A user.", + "properties": { + "company": { + "description": "The user's company.", + "type": "string" + }, + "created_at": { + "description": "The date and time the user was created.", + "format": "partial-date-time", + "type": "string" + }, + "discord": { + "description": "The user's Discord handle.", + "type": "string" + }, + "email": { + "description": "The email address of the user.", + "type": "string" + }, + "email_verified": { + "description": "The date and time the email address was verified.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "first_name": { + "description": "The user's first name.", + "type": "string" + }, + "github": { + "description": "The user's GitHub handle.", + "type": "string" + }, + "id": { + "description": "The unique identifier for the user.", + "type": "string" + }, + "image": { + "description": "The image avatar for the user. This is a URL.", + "type": "string" + }, + "last_name": { + "description": "The user's last name.", + "type": "string" + }, + "name": { + "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", + "type": "string" + }, + "phone": { + "description": "The user's phone number.", + "type": "string" + }, + "updated_at": { + "description": "The date and time the user was last updated.", + "format": "partial-date-time", + "type": "string" + } + }, + "required": [ + "created_at", + "updated_at" + ], + "type": "object" + }, + "UserResultsPage": { + "description": "A single page of results", + "properties": { + "items": { + "description": "list of items on this page of results", + "items": { + "$ref": "#/components/schemas/User", + "x-scope": [ + "", + "#/components/schemas/UserResultsPage" + ] + }, + "type": "array" + }, + "next_page": { + "description": "token used to fetch the next page of results (if any)", + "nullable": true, + "type": "string" + } + }, + "required": [ + "items" + ], + "type": "object" + }, + "Uuid": { + "description": "A uuid.\n\nA Version 4 UUID is a universally unique identifier that is generated using random numbers.", + "format": "uuid", + "type": "string" } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get CAD file volume.", - "tags": [ - "file", - "beta" - ], - "x-go": { - "example": "// CreateVolume: Get CAD file volume.\n//\n// Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\n// 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.\n//\n// Parameters:\n//\t- `srcFormat`: The format of the file.\nfileVolume, err := client.File.CreateVolume(srcFormat, body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateVolume" } - } }, - "/login": { - "post": { - "operationId": "login", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginParams" - } - } - }, - "required": true + "info": { + "contact": { + "email": "api@kittycad.io", + "url": "https://kittycad.io" }, - "responses": { - "204": { - "description": "resource updated", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Set-Cookie": { - "description": "Set-Cookie header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "This endpoint sets a session cookie for a user.", - "tags": [ - "hidden" - ], + "description": "API server for KittyCAD", + "title": "KittyCAD API", + "version": "0.1.0", "x-go": { - "example": "// Login: This endpoint sets a session cookie for a user.\nif err := client.Hidden.Login(body); err != nil {\n\tpanic(err)\n}", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#HiddenService.Login" + "client": "// Create a client with your token.\nclient, err := kittycad.NewClient(\"$TOKEN\", \"your apps user agent\")\nif err != nil {\n panic(err)\n}\n\n// - OR -\n\n// Create a new client with your token parsed from the environment\n// variable: KITTYCAD_API_TOKEN.\nclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\nif err != nil {\n panic(err)\n}", + "install": "go get github.com/kittycad/kittycad.go" + }, + "x-python": { + "client": "# Create a client with your token.\nfrom kittycad import Client\n\nclient = Client(token=\"$TOKEN\")\n\n# - OR -\n\n# Create a new client with your token parsed from the environment variable:\n# KITTYCAD_API_TOKEN.\nfrom kittycad import ClientFromEnv\n\nclient = ClientFromEnv()", + "install": "pip install kittycad" } - } }, - "/ping": { - "get": { - "operationId": "ping", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pong" + "openapi": "3.0.3", + "paths": { + "/": { + "get": { + "operationId": "get_schema", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get OpenAPI schema.", + "tags": [ + "meta" + ], + "x-go": { + "example": "// GetSchema: Get OpenAPI schema.\nresponseGetSchema, err := client.Meta.GetSchema()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.GetSchema" + }, + "x-python": { + "example": "from kittycad.models import dict\nfrom kittycad.api.meta import get_schema\nfrom kittycad.types import Response\n\nfc: dict = get_schema.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[dict] = get_schema.sync_detailed(client=client)\n\n# OR run async\nfc: dict = await get_schema.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[dict] = await get_schema.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.meta.get_schema.html" } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } }, - "summary": "Return pong.", - "tags": [ - "meta" - ], - "x-go": { - "example": "// Ping: Return pong.\npong, err := client.Meta.Ping()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Ping" + "/_meta/info": { + "get": { + "description": "This includes information on any of our other distributed systems it is connected to.\nYou must be a KittyCAD employee to perform this request.", + "operationId": "get_metadata", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Metadata", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get the metadata about our currently running server.", + "tags": [ + "meta" + ], + "x-go": { + "example": "// Getdata: Get the metadata about our currently running server.\n//\n// This includes information on any of our other distributed systems it is connected to.\n// You must be a KittyCAD employee to perform this request.\nmetadata, err := client.Meta.Getdata()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Getdata" + }, + "x-python": { + "example": "from kittycad.models import Metadata\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.types import Response\n\nfc: Metadata = get_metadata.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Metadata] = get_metadata.sync_detailed(client=client)\n\n# OR run async\nfc: Metadata = await get_metadata.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[Metadata] = await get_metadata.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.meta.get_metadata.html" + } + } + }, + "/api-call-metrics": { + "get": { + "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.", + "operationId": "get_api_call_metrics", + "parameters": [ + { + "description": "What field to group the metrics by.", + "in": "query", + "name": "group_by", + "required": true, + "schema": { + "$ref": "#/components/schemas/ApiCallQueryGroupBy", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/ApiCallQueryGroup", + "x-scope": [ + "" + ] + }, + "title": "Array_of_ApiCallQueryGroup", + "type": "array" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get API call metrics.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// GetMetrics: Get API call metrics.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.\n//\n// Parameters:\n//\t- `groupBy`: What field to group the metrics by.\nAPICallQueryGroup, err := client.APICall.GetMetrics(groupBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetMetrics" + }, + "x-python": { + "example": "from kittycad.models import [ApiCallQueryGroup]\nfrom kittycad.api.api-calls import get_api_call_metrics\nfrom kittycad.types import Response\n\nfc: [ApiCallQueryGroup] = get_api_call_metrics.sync(client=client, group_by=ApiCallQueryGroupBy)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[[ApiCallQueryGroup]] = get_api_call_metrics.sync_detailed(client=client, group_by=ApiCallQueryGroupBy)\n\n# OR run async\nfc: [ApiCallQueryGroup] = await get_api_call_metrics.asyncio(client=client, group_by=ApiCallQueryGroupBy)\n\n# OR run async with more info\nresponse: Response[[ApiCallQueryGroup]] = await get_api_call_metrics.asyncio_detailed(client=client, group_by=ApiCallQueryGroupBy)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.get_api_call_metrics.html" + } + } + }, + "/api-calls": { + "get": { + "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.", + "operationId": "list_api_calls", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPriceResultsPage", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List API calls.", + "tags": [ + "api-calls" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// List: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.List" + }, + "x-python": { + "example": "from kittycad.models import ApiCallWithPriceResultsPage\nfrom kittycad.api.api-calls import list_api_calls\nfrom kittycad.types import Response\n\nfc: ApiCallWithPriceResultsPage = list_api_calls.sync(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiCallWithPriceResultsPage] = list_api_calls.sync_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async\nfc: ApiCallWithPriceResultsPage = await list_api_calls.asyncio(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async with more info\nresponse: Response[ApiCallWithPriceResultsPage] = await list_api_calls.asyncio_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.list_api_calls.html" + } + } + }, + "/api-calls/{id}": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\nIf the user is not authenticated to view the specified API call, then it is not returned.\nOnly KittyCAD employees can view API calls for other users.", + "operationId": "get_api_call", + "parameters": [ + { + "description": "The ID of the API call.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPrice", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get details of an API call.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// Get: Get details of an API call.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n// If the user is not authenticated to view the specified API call, then it is not returned.\n// Only KittyCAD employees can view API calls for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.Get(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.Get" + }, + "x-python": { + "example": "from kittycad.models import ApiCallWithPrice\nfrom kittycad.api.api-calls import get_api_call\nfrom kittycad.types import Response\n\nfc: ApiCallWithPrice = get_api_call.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiCallWithPrice] = get_api_call.sync_detailed(client=client, id=)\n\n# OR run async\nfc: ApiCallWithPrice = await get_api_call.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[ApiCallWithPrice] = await get_api_call.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.get_api_call.html" + } + } + }, + "/async/operations/{id}": { + "get": { + "description": "Get the status and output of an async operation.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.\nIf the user is not authenticated to view the specified async operation, then it is not returned.\nOnly KittyCAD employees with the proper access can view async operations for other users.", + "operationId": "get_async_operation", + "parameters": [ + { + "description": "The ID of the async operation.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncApiCallOutput", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get an async operation.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// GetAsyncOperation: Get an async operation.\n//\n// Get the status and output of an async operation.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.\n// If the user is not authenticated to view the specified async operation, then it is not returned.\n// Only KittyCAD employees with the proper access can view async operations for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.APICall.GetAsyncOperation(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetAsyncOperation" + }, + "x-python": { + "example": "from kittycad.models import AsyncApiCallOutput\nfrom kittycad.api.api-calls import get_async_operation\nfrom kittycad.types import Response\n\nfc: AsyncApiCallOutput = get_async_operation.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[AsyncApiCallOutput] = get_async_operation.sync_detailed(client=client, id=)\n\n# OR run async\nfc: AsyncApiCallOutput = await get_async_operation.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[AsyncApiCallOutput] = await get_async_operation.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.get_async_operation.html" + } + } + }, + "/file/conversion/{src_format}/{output_format}": { + "post": { + "description": "Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\nIf the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nIf 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.", + "operationId": "create_file_conversion", + "parameters": [ + { + "description": "The format the file should be converted to.", + "in": "path", + "name": "output_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileOutputFormat", + "x-scope": [ + "" + ] + }, + "style": "simple" + }, + { + "description": "The format of the file to convert.", + "in": "path", + "name": "src_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileSourceFormat", + "x-scope": [ + "" + ] + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileConversion", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Convert CAD file.", + "tags": [ + "file" + ], + "x-go": { + "example": "// CreateConversion: Convert CAD file.\n//\n// Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\n// If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// 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.\n//\n// Parameters:\n//\t- `outputFormat`: The format the file should be converted to.\n//\t- `srcFormat`: The format of the file to convert.\nfileConversion, err := client.File.CreateConversion(outputFormat, srcFormat, body)\n\n// - OR -\n\n// CreateConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the CreateConversion function.\nfileConversion, err := client.File.CreateConversionWithBase64Helper(outputFormat, srcFormat, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateConversion" + }, + "x-python": { + "example": "from kittycad.models import FileConversion\nfrom kittycad.api.file import create_file_conversion_with_base64_helper\nfrom kittycad.types import Response\n\nfc: FileConversion = create_file_conversion_with_base64_helper.sync(client=client, output_format=FileOutputFormat, src_format=FileSourceFormat, body=bytes)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[FileConversion] = create_file_conversion_with_base64_helper.sync_detailed(client=client, output_format=FileOutputFormat, src_format=FileSourceFormat, body=bytes)\n\n# OR run async\nfc: FileConversion = await create_file_conversion_with_base64_helper.asyncio(client=client, output_format=FileOutputFormat, src_format=FileSourceFormat, body=bytes)\n\n# OR run async with more info\nresponse: Response[FileConversion] = await create_file_conversion_with_base64_helper.asyncio_detailed(client=client, output_format=FileOutputFormat, src_format=FileSourceFormat, body=bytes)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.file.create_file_conversion_with_base64_helper.html" + } + } + }, + "/file/conversions/{id}": { + "get": { + "description": "Get the status and output of an async file conversion.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\nIf the user is not authenticated to view the specified file conversion, then it is not returned.\nOnly KittyCAD employees with the proper access can view file conversions for other users.", + "operationId": "get_file_conversion", + "parameters": [ + { + "description": "The ID of the async operation.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncApiCallOutput", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get a file conversion.", + "tags": [ + "file" + ], + "x-go": { + "example": "// GetConversion: Get a file conversion.\n//\n// Get the status and output of an async file conversion.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n// If the user is not authenticated to view the specified file conversion, then it is not returned.\n// Only KittyCAD employees with the proper access can view file conversions for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.File.GetConversion(id)\n\n// - OR -\n\n// GetConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the GetConversion function.\nasyncAPICallOutput, err := client.File.GetConversionWithBase64Helper(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversion" + }, + "x-python": { + "example": "from kittycad.models import AsyncApiCallOutput\nfrom kittycad.api.file import get_file_conversion_with_base64_helper\nfrom kittycad.types import Response\n\nfc: AsyncApiCallOutput = get_file_conversion_with_base64_helper.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[AsyncApiCallOutput] = get_file_conversion_with_base64_helper.sync_detailed(client=client, id=)\n\n# OR run async\nfc: AsyncApiCallOutput = await get_file_conversion_with_base64_helper.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[AsyncApiCallOutput] = await get_file_conversion_with_base64_helper.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.file.get_file_conversion_with_base64_helper.html" + } + } + }, + "/file/execute/{lang}": { + "post": { + "operationId": "create_file_execution", + "parameters": [ + { + "description": "The language of the code.", + "in": "path", + "name": "lang", + "required": true, + "schema": { + "$ref": "#/components/schemas/CodeLanguage", + "x-scope": [ + "" + ] + }, + "style": "simple" + }, + { + "description": "The output file we want to get the contents for (this is relative to where in litterbox it is being run).", + "in": "query", + "name": "output", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CodeOutput", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Execute a KittyCAD program in a specific language.", + "tags": [ + "file" + ], + "x-go": { + "example": "// CreateExecution: Execute a KittyCAD program in a specific language.\n//\n// Parameters:\n//\t- `lang`: The language of the code.\n//\t- `output`: The output file we want to get the contents for (this is relative to where in litterbox it is being run).\ncodeOutput, err := client.File.CreateExecution(lang, output, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateExecution" + }, + "x-python": { + "example": "from kittycad.models import CodeOutput\nfrom kittycad.api.file import create_file_execution\nfrom kittycad.types import Response\n\nfc: CodeOutput = create_file_execution.sync(client=client, lang=CodeLanguage, output=, body=bytes)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[CodeOutput] = create_file_execution.sync_detailed(client=client, lang=CodeLanguage, output=, body=bytes)\n\n# OR run async\nfc: CodeOutput = await create_file_execution.asyncio(client=client, lang=CodeLanguage, output=, body=bytes)\n\n# OR run async with more info\nresponse: Response[CodeOutput] = await create_file_execution.asyncio_detailed(client=client, lang=CodeLanguage, output=, body=bytes)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.file.create_file_execution.html" + } + } + }, + "/file/mass": { + "post": { + "description": "Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\nIf 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.", + "operationId": "create_file_mass", + "parameters": [ + { + "description": "The material density.", + "in": "query", + "name": "material_density", + "required": true, + "schema": { + "format": "float", + "type": "number" + }, + "style": "form" + }, + { + "description": "The format of the file.", + "in": "query", + "name": "src_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileSourceFormat", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileMass", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get CAD file mass.", + "tags": [ + "file", + "beta" + ], + "x-go": { + "example": "// CreateMass: Get CAD file mass.\n//\n// Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\n// 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.\n//\n// Parameters:\n//\t- `materialDensity`: The material density.\n//\t- `srcFormat`: The format of the file.\nfileMass, err := client.File.CreateMass(materialDensity, srcFormat, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateMass" + }, + "x-python": { + "example": "from kittycad.models import FileMass\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.types import Response\n\nfc: FileMass = create_file_mass.sync(client=client, material_density=\"\", src_format=FileSourceFormat, body=bytes)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[FileMass] = create_file_mass.sync_detailed(client=client, material_density=\"\", src_format=FileSourceFormat, body=bytes)\n\n# OR run async\nfc: FileMass = await create_file_mass.asyncio(client=client, material_density=\"\", src_format=FileSourceFormat, body=bytes)\n\n# OR run async with more info\nresponse: Response[FileMass] = await create_file_mass.asyncio_detailed(client=client, material_density=\"\", src_format=FileSourceFormat, body=bytes)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.file.create_file_mass.html" + } + } + }, + "/file/volume": { + "post": { + "description": "Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\nIf 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.", + "operationId": "create_file_volume", + "parameters": [ + { + "description": "The format of the file.", + "in": "query", + "name": "src_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileSourceFormat", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileVolume", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get CAD file volume.", + "tags": [ + "file", + "beta" + ], + "x-go": { + "example": "// CreateVolume: Get CAD file volume.\n//\n// Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\n// 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.\n//\n// Parameters:\n//\t- `srcFormat`: The format of the file.\nfileVolume, err := client.File.CreateVolume(srcFormat, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateVolume" + }, + "x-python": { + "example": "from kittycad.models import FileVolume\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.types import Response\n\nfc: FileVolume = create_file_volume.sync(client=client, src_format=FileSourceFormat, body=bytes)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[FileVolume] = create_file_volume.sync_detailed(client=client, src_format=FileSourceFormat, body=bytes)\n\n# OR run async\nfc: FileVolume = await create_file_volume.asyncio(client=client, src_format=FileSourceFormat, body=bytes)\n\n# OR run async with more info\nresponse: Response[FileVolume] = await create_file_volume.asyncio_detailed(client=client, src_format=FileSourceFormat, body=bytes)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.file.create_file_volume.html" + } + } + }, + "/login": { + "post": { + "operationId": "login", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginParams", + "x-scope": [ + "" + ] + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "resource updated", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Set-Cookie": { + "description": "Set-Cookie header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "This endpoint sets a session cookie for a user.", + "tags": [ + "hidden" + ], + "x-go": { + "example": "// Login: This endpoint sets a session cookie for a user.\nif err := client.Hidden.Login(body); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#HiddenService.Login" + }, + "x-python": { + "example": "from kittycad.models import Error\nfrom kittycad.api.hidden import login\nfrom kittycad.types import Response\n\nfc: Error = login.sync(client=client, body=LoginParams)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Error] = login.sync_detailed(client=client, body=LoginParams)\n\n# OR run async\nfc: Error = await login.asyncio(client=client, body=LoginParams)\n\n# OR run async with more info\nresponse: Response[Error] = await login.asyncio_detailed(client=client, body=LoginParams)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.hidden.login.html" + } + } + }, + "/ping": { + "get": { + "operationId": "ping", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pong", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Return pong.", + "tags": [ + "meta" + ], + "x-go": { + "example": "// Ping: Return pong.\npong, err := client.Meta.Ping()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Ping" + }, + "x-python": { + "example": "from kittycad.models import Pong\nfrom kittycad.api.meta import ping\nfrom kittycad.types import Response\n\nfc: Pong = ping.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Pong] = ping.sync_detailed(client=client)\n\n# OR run async\nfc: Pong = await ping.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[Pong] = await ping.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.meta.ping.html" + } + } + }, + "/user": { + "get": { + "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", + "operationId": "get_user_self", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get your user.", + "tags": [ + "users" + ], + "x-go": { + "example": "// GetSelf: Get your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nuser, err := client.User.GetSelf()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelf" + }, + "x-python": { + "example": "from kittycad.models import User\nfrom kittycad.api.users import get_user_self\nfrom kittycad.types import Response\n\nfc: User = get_user_self.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[User] = get_user_self.sync_detailed(client=client)\n\n# OR run async\nfc: User = await get_user_self.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[User] = await get_user_self.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.get_user_self.html" + } + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE and PUT.", + "operationId": "options_user_self", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "enum": [ + null + ], + "title": "Null", + "type": "string" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "OPTIONS endpoint for users.", + "tags": [ + "hidden" + ] + }, + "put": { + "description": "This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.", + "operationId": "update_user_self", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateUser", + "x-scope": [ + "" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Update your user.", + "tags": [ + "users" + ], + "x-go": { + "example": "// UpdateSelf: Update your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.\nuser, err := client.User.UpdateSelf(body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.UpdateSelf" + }, + "x-python": { + "example": "from kittycad.models import User\nfrom kittycad.api.users import update_user_self\nfrom kittycad.types import Response\n\nfc: User = update_user_self.sync(client=client, body=UpdateUser)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[User] = update_user_self.sync_detailed(client=client, body=UpdateUser)\n\n# OR run async\nfc: User = await update_user_self.asyncio(client=client, body=UpdateUser)\n\n# OR run async with more info\nresponse: Response[User] = await update_user_self.asyncio_detailed(client=client, body=UpdateUser)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.update_user_self.html" + } + } + }, + "/user/api-calls": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\nThe API calls are returned in order of creation, with the most recently created API calls first.", + "operationId": "user_list_api_calls", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPriceResultsPage", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List API calls for your user.", + "tags": [ + "api-calls" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// UserList: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `UserListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.UserList(limit, pageToken, sortBy)\n\n// - OR -\n\n// UserListAllPages: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `UserList` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.UserListAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.UserList" + }, + "x-python": { + "example": "from kittycad.models import ApiCallWithPriceResultsPage\nfrom kittycad.api.api-calls import user_list_api_calls\nfrom kittycad.types import Response\n\nfc: ApiCallWithPriceResultsPage = user_list_api_calls.sync(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiCallWithPriceResultsPage] = user_list_api_calls.sync_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async\nfc: ApiCallWithPriceResultsPage = await user_list_api_calls.asyncio(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async with more info\nresponse: Response[ApiCallWithPriceResultsPage] = await user_list_api_calls.asyncio_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.user_list_api_calls.html" + } + } + }, + "/user/api-calls/{id}": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.", + "operationId": "get_api_call_for_user", + "parameters": [ + { + "description": "The ID of the API call.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPrice", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get an API call for a user.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// GetForUser: Get an API call for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.GetForUser(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetForUser" + }, + "x-python": { + "example": "from kittycad.models import ApiCallWithPrice\nfrom kittycad.api.api-calls import get_api_call_for_user\nfrom kittycad.types import Response\n\nfc: ApiCallWithPrice = get_api_call_for_user.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiCallWithPrice] = get_api_call_for_user.sync_detailed(client=client, id=)\n\n# OR run async\nfc: ApiCallWithPrice = await get_api_call_for_user.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[ApiCallWithPrice] = await get_api_call_for_user.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.get_api_call_for_user.html" + } + } + }, + "/user/api-tokens": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\nThe API tokens are returned in order of creation, with the most recently created API tokens first.", + "operationId": "list_api_tokens_for_user", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiTokenResultsPage", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List API tokens for your user.", + "tags": [ + "api-tokens" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// ListForUser: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPITokenResultsPage, err := client.APIToken.ListForUser(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPIToken, err := client.APIToken.ListForUserAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.ListForUser" + }, + "x-python": { + "example": "from kittycad.models import ApiTokenResultsPage\nfrom kittycad.api.api-tokens import list_api_tokens_for_user\nfrom kittycad.types import Response\n\nfc: ApiTokenResultsPage = list_api_tokens_for_user.sync(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiTokenResultsPage] = list_api_tokens_for_user.sync_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async\nfc: ApiTokenResultsPage = await list_api_tokens_for_user.asyncio(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async with more info\nresponse: Response[ApiTokenResultsPage] = await list_api_tokens_for_user.asyncio_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-tokens.list_api_tokens_for_user.html" + } + }, + "post": { + "description": "This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.", + "operationId": "create_api_token_for_user", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiToken", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Create a new API token for your user.", + "tags": [ + "api-tokens" + ], + "x-go": { + "example": "// CreateForUser: Create a new API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.\naPIToken, err := client.APIToken.CreateForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.CreateForUser" + }, + "x-python": { + "example": "from kittycad.models import ApiToken\nfrom kittycad.api.api-tokens import create_api_token_for_user\nfrom kittycad.types import Response\n\nfc: ApiToken = create_api_token_for_user.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiToken] = create_api_token_for_user.sync_detailed(client=client)\n\n# OR run async\nfc: ApiToken = await create_api_token_for_user.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[ApiToken] = await create_api_token_for_user.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-tokens.create_api_token_for_user.html" + } + } + }, + "/user/api-tokens/{token}": { + "delete": { + "description": "This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\nThis endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.", + "operationId": "delete_api_token_for_user", + "parameters": [ + { + "description": "The API token.", + "in": "path", + "name": "token", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "successful deletion", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Delete an API token for your user.", + "tags": [ + "api-tokens" + ], + "x-go": { + "example": "// DeleteForUser: Delete an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n//\n// Parameters:\n//\t- `token`: The API token.\nif err := client.APIToken.DeleteForUser(token); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.DeleteForUser" + }, + "x-python": { + "example": "from kittycad.models import Error\nfrom kittycad.api.api-tokens import delete_api_token_for_user\nfrom kittycad.types import Response\n\nfc: Error = delete_api_token_for_user.sync(client=client, token=\"\")\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Error] = delete_api_token_for_user.sync_detailed(client=client, token=\"\")\n\n# OR run async\nfc: Error = await delete_api_token_for_user.asyncio(client=client, token=\"\")\n\n# OR run async with more info\nresponse: Response[Error] = await delete_api_token_for_user.asyncio_detailed(client=client, token=\"\")", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-tokens.delete_api_token_for_user.html" + } + }, + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.", + "operationId": "get_api_token_for_user", + "parameters": [ + { + "description": "The API token.", + "in": "path", + "name": "token", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiToken", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get an API token for your user.", + "tags": [ + "api-tokens" + ], + "x-go": { + "example": "// GetForUser: Get an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.\n//\n// Parameters:\n//\t- `token`: The API token.\naPIToken, err := client.APIToken.GetForUser(token)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.GetForUser" + }, + "x-python": { + "example": "from kittycad.models import ApiToken\nfrom kittycad.api.api-tokens import get_api_token_for_user\nfrom kittycad.types import Response\n\nfc: ApiToken = get_api_token_for_user.sync(client=client, token=\"\")\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiToken] = get_api_token_for_user.sync_detailed(client=client, token=\"\")\n\n# OR run async\nfc: ApiToken = await get_api_token_for_user.asyncio(client=client, token=\"\")\n\n# OR run async with more info\nresponse: Response[ApiToken] = await get_api_token_for_user.asyncio_detailed(client=client, token=\"\")", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-tokens.get_api_token_for_user.html" + } + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE.", + "operationId": "options_api_token_for_user", + "parameters": [ + { + "description": "The API token.", + "in": "path", + "name": "token", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "enum": [ + null + ], + "title": "Null", + "type": "string" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "OPTIONS endpoint for API tokens.", + "tags": [ + "hidden" + ] + } + }, + "/user/extended": { + "get": { + "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", + "operationId": "get_user_self_extended", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendedUser", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get extended information about your user.", + "tags": [ + "users" + ], + "x-go": { + "example": "// GetSelfExtended: Get extended information about your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nextendedUser, err := client.User.GetSelfExtended()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelfExtended" + }, + "x-python": { + "example": "from kittycad.models import ExtendedUser\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.types import Response\n\nfc: ExtendedUser = get_user_self_extended.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ExtendedUser] = get_user_self_extended.sync_detailed(client=client)\n\n# OR run async\nfc: ExtendedUser = await get_user_self_extended.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[ExtendedUser] = await get_user_self_extended.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.get_user_self_extended.html" + } + } + }, + "/user/file/conversions/{id}": { + "get": { + "description": "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.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.", + "operationId": "get_file_conversion_for_user", + "parameters": [ + { + "description": "The ID of the async operation.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncApiCallOutput", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get a file conversion for your user.", + "tags": [ + "file" + ], + "x-go": { + "example": "// GetConversionForUser: Get a file conversion for your user.\n//\n// 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.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.File.GetConversionForUser(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversionForUser" + }, + "x-python": { + "example": "from kittycad.models import AsyncApiCallOutput\nfrom kittycad.api.file import get_file_conversion_for_user\nfrom kittycad.types import Response\n\nfc: AsyncApiCallOutput = get_file_conversion_for_user.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[AsyncApiCallOutput] = get_file_conversion_for_user.sync_detailed(client=client, id=)\n\n# OR run async\nfc: AsyncApiCallOutput = await get_file_conversion_for_user.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[AsyncApiCallOutput] = await get_file_conversion_for_user.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.file.get_file_conversion_for_user.html" + } + } + }, + "/user/payment": { + "delete": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.", + "operationId": "delete_payment_information_for_user", + "responses": { + "204": { + "description": "successful deletion", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Delete payment info for your user.", + "tags": [ + "payments" + ], + "x-go": { + "example": "// DeleteInformationForUser: Delete payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.\nif err := client.Payment.DeleteInformationForUser(); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.DeleteInformationForUser" + }, + "x-python": { + "example": "from kittycad.models import Error\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.types import Response\n\nfc: Error = delete_payment_information_for_user.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Error] = delete_payment_information_for_user.sync_detailed(client=client)\n\n# OR run async\nfc: Error = await delete_payment_information_for_user.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[Error] = await delete_payment_information_for_user.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.delete_payment_information_for_user.html" + } + }, + "get": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.", + "operationId": "get_payment_information_for_user", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get payment info about your user.", + "tags": [ + "payments" + ], + "x-go": { + "example": "// GetInformationForUser: Get payment info about your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.\ncustomer, err := client.Payment.GetInformationForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.GetInformationForUser" + }, + "x-python": { + "example": "from kittycad.models import Customer\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.types import Response\n\nfc: Customer = get_payment_information_for_user.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Customer] = get_payment_information_for_user.sync_detailed(client=client)\n\n# OR run async\nfc: Customer = await get_payment_information_for_user.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[Customer] = await get_payment_information_for_user.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.get_payment_information_for_user.html" + } + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE and PUT.", + "operationId": "options_payment_information_for_user", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "enum": [ + null + ], + "title": "Null", + "type": "string" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "OPTIONS endpoint for user payment information.", + "tags": [ + "hidden" + ] + }, + "post": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.", + "operationId": "create_payment_information_for_user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BillingInfo", + "x-scope": [ + "" + ] + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Create payment info for your user.", + "tags": [ + "payments" + ], + "x-go": { + "example": "// CreateInformationForUser: Create payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.\ncustomer, err := client.Payment.CreateInformationForUser(body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.CreateInformationForUser" + }, + "x-python": { + "example": "from kittycad.models import Customer\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.types import Response\n\nfc: Customer = create_payment_information_for_user.sync(client=client, body=BillingInfo)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Customer] = create_payment_information_for_user.sync_detailed(client=client, body=BillingInfo)\n\n# OR run async\nfc: Customer = await create_payment_information_for_user.asyncio(client=client, body=BillingInfo)\n\n# OR run async with more info\nresponse: Response[Customer] = await create_payment_information_for_user.asyncio_detailed(client=client, body=BillingInfo)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.create_payment_information_for_user.html" + } + }, + "put": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.", + "operationId": "update_payment_information_for_user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BillingInfo", + "x-scope": [ + "" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Update payment info for your user.", + "tags": [ + "payments" + ], + "x-go": { + "example": "// UpdateInformationForUser: Update payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.\ncustomer, err := client.Payment.UpdateInformationForUser(body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.UpdateInformationForUser" + }, + "x-python": { + "example": "from kittycad.models import Customer\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.types import Response\n\nfc: Customer = update_payment_information_for_user.sync(client=client, body=BillingInfo)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Customer] = update_payment_information_for_user.sync_detailed(client=client, body=BillingInfo)\n\n# OR run async\nfc: Customer = await update_payment_information_for_user.asyncio(client=client, body=BillingInfo)\n\n# OR run async with more info\nresponse: Response[Customer] = await update_payment_information_for_user.asyncio_detailed(client=client, body=BillingInfo)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.update_payment_information_for_user.html" + } + } + }, + "/user/payment/intent": { + "post": { + "description": "This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.", + "operationId": "create_payment_intent_for_user", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentIntent", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Create a payment intent for your user.", + "tags": [ + "payments", + "hidden" + ], + "x-go": { + "example": "// CreateIntentForUser: Create a payment intent for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.\npaymentIntent, err := client.Payment.CreateIntentForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.CreateIntentForUser" + }, + "x-python": { + "example": "from kittycad.models import PaymentIntent\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.types import Response\n\nfc: PaymentIntent = create_payment_intent_for_user.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[PaymentIntent] = create_payment_intent_for_user.sync_detailed(client=client)\n\n# OR run async\nfc: PaymentIntent = await create_payment_intent_for_user.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[PaymentIntent] = await create_payment_intent_for_user.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.create_payment_intent_for_user.html" + } + } + }, + "/user/payment/invoices": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.", + "operationId": "list_invoices_for_user", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Invoice", + "x-scope": [ + "" + ] + }, + "title": "Array_of_Invoice", + "type": "array" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List invoices for your user.", + "tags": [ + "payments" + ], + "x-go": { + "example": "// ListInvoicesForUser: List invoices for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.\nInvoice, err := client.Payment.ListInvoicesForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.ListInvoicesForUser" + }, + "x-python": { + "example": "from kittycad.models import [Invoice]\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.types import Response\n\nfc: [Invoice] = list_invoices_for_user.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[[Invoice]] = list_invoices_for_user.sync_detailed(client=client)\n\n# OR run async\nfc: [Invoice] = await list_invoices_for_user.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[[Invoice]] = await list_invoices_for_user.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.list_invoices_for_user.html" + } + } + }, + "/user/payment/methods": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.", + "operationId": "list_payment_methods_for_user", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/PaymentMethod", + "x-scope": [ + "" + ] + }, + "title": "Array_of_PaymentMethod", + "type": "array" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List payment methods for your user.", + "tags": [ + "payments" + ], + "x-go": { + "example": "// ListMethodsForUser: List payment methods for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.\nPaymentMethod, err := client.Payment.ListMethodsForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.ListMethodsForUser" + }, + "x-python": { + "example": "from kittycad.models import [PaymentMethod]\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.types import Response\n\nfc: [PaymentMethod] = list_payment_methods_for_user.sync(client=client)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[[PaymentMethod]] = list_payment_methods_for_user.sync_detailed(client=client)\n\n# OR run async\nfc: [PaymentMethod] = await list_payment_methods_for_user.asyncio(client=client)\n\n# OR run async with more info\nresponse: Response[[PaymentMethod]] = await list_payment_methods_for_user.asyncio_detailed(client=client)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.list_payment_methods_for_user.html" + } + } + }, + "/user/payment/methods/{id}": { + "delete": { + "description": "This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.", + "operationId": "delete_payment_method_for_user", + "parameters": [ + { + "description": "The ID of the payment method.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "204": { + "description": "successful deletion", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Delete a payment method for your user.", + "tags": [ + "payments", + "hidden" + ], + "x-go": { + "example": "// DeleteMethodForUser: Delete a payment method for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.\n//\n// Parameters:\n//\t- `id`: The ID of the payment method.\nif err := client.Payment.DeleteMethodForUser(id); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.DeleteMethodForUser" + }, + "x-python": { + "example": "from kittycad.models import Error\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.types import Response\n\nfc: Error = delete_payment_method_for_user.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Error] = delete_payment_method_for_user.sync_detailed(client=client, id=)\n\n# OR run async\nfc: Error = await delete_payment_method_for_user.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[Error] = await delete_payment_method_for_user.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.payments.delete_payment_method_for_user.html" + } + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE.", + "operationId": "options_payment_methods_for_user", + "parameters": [ + { + "description": "The ID of the payment method.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "enum": [ + null + ], + "title": "Null", + "type": "string" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "OPTIONS endpoint for user payment methods.", + "tags": [ + "hidden" + ] + } + }, + "/user/session/{token}": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.", + "operationId": "get_session_for_user", + "parameters": [ + { + "description": "The API token.", + "in": "path", + "name": "token", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get a session for your user.", + "tags": [ + "sessions" + ], + "x-go": { + "example": "// GetForUser: Get a session for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.\n//\n// Parameters:\n//\t- `token`: The API token.\nsession, err := client.Session.GetForUser(token)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#SessionService.GetForUser" + }, + "x-python": { + "example": "from kittycad.models import Session\nfrom kittycad.api.sessions import get_session_for_user\nfrom kittycad.types import Response\n\nfc: Session = get_session_for_user.sync(client=client, token=\"\")\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[Session] = get_session_for_user.sync_detailed(client=client, token=\"\")\n\n# OR run async\nfc: Session = await get_session_for_user.asyncio(client=client, token=\"\")\n\n# OR run async with more info\nresponse: Response[Session] = await get_session_for_user.asyncio_detailed(client=client, token=\"\")", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.sessions.get_session_for_user.html" + } + } + }, + "/users": { + "get": { + "description": "This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.", + "operationId": "list_users", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserResultsPage", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List users.", + "tags": [ + "users" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// List: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\nuserResultsPage, err := client.User.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nUser, err := client.User.ListAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.List" + }, + "x-python": { + "example": "from kittycad.models import UserResultsPage\nfrom kittycad.api.users import list_users\nfrom kittycad.types import Response\n\nfc: UserResultsPage = list_users.sync(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[UserResultsPage] = list_users.sync_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async\nfc: UserResultsPage = await list_users.asyncio(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async with more info\nresponse: Response[UserResultsPage] = await list_users.asyncio_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.list_users.html" + } + } + }, + "/users-extended": { + "get": { + "description": "This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.", + "operationId": "list_users_extended", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendedUserResultsPage", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List users with extended information.", + "tags": [ + "users" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// ListExtended: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListExtendedAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\nextendedUserResultsPage, err := client.User.ListExtended(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListExtendedAllPages: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `ListExtended` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nExtendedUser, err := client.User.ListExtendedAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.ListExtended" + }, + "x-python": { + "example": "from kittycad.models import ExtendedUserResultsPage\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.types import Response\n\nfc: ExtendedUserResultsPage = list_users_extended.sync(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ExtendedUserResultsPage] = list_users_extended.sync_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async\nfc: ExtendedUserResultsPage = await list_users_extended.asyncio(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async with more info\nresponse: Response[ExtendedUserResultsPage] = await list_users_extended.asyncio_detailed(client=client, limit=\"\", page_token=, sort_by=CreatedAtSortMode)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.list_users_extended.html" + } + } + }, + "/users-extended/{id}": { + "get": { + "description": "To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.\nAlternatively, to get information about the authenticated user, use `/user/extended` endpoint.\nTo get information about any KittyCAD user, you must be a KittyCAD employee.", + "operationId": "get_user_extended", + "parameters": [ + { + "description": "The user ID.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExtendedUser", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get extended information about a user.", + "tags": [ + "users" + ], + "x-go": { + "example": "// GetExtended: Get extended information about a user.\n//\n// To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.\n// Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.\n// To get information about any KittyCAD user, you must be a KittyCAD employee.\n//\n// Parameters:\n//\t- `id`: The user ID.\nextendedUser, err := client.User.GetExtended(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetExtended" + }, + "x-python": { + "example": "from kittycad.models import ExtendedUser\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.types import Response\n\nfc: ExtendedUser = get_user_extended.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ExtendedUser] = get_user_extended.sync_detailed(client=client, id=)\n\n# OR run async\nfc: ExtendedUser = await get_user_extended.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[ExtendedUser] = await get_user_extended.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.get_user_extended.html" + } + } + }, + "/users/{id}": { + "get": { + "description": "To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.\nAlternatively, to get information about the authenticated user, use `/user` endpoint.\nTo get information about any KittyCAD user, you must be a KittyCAD employee.", + "operationId": "get_user", + "parameters": [ + { + "description": "The user ID.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "Get a user.", + "tags": [ + "users" + ], + "x-go": { + "example": "// Get: Get a user.\n//\n// To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.\n// Alternatively, to get information about the authenticated user, use `/user` endpoint.\n// To get information about any KittyCAD user, you must be a KittyCAD employee.\n//\n// Parameters:\n//\t- `id`: The user ID.\nuser, err := client.User.Get(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.Get" + }, + "x-python": { + "example": "from kittycad.models import User\nfrom kittycad.api.users import get_user\nfrom kittycad.types import Response\n\nfc: User = get_user.sync(client=client, id=)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[User] = get_user.sync_detailed(client=client, id=)\n\n# OR run async\nfc: User = await get_user.asyncio(client=client, id=)\n\n# OR run async with more info\nresponse: Response[User] = await get_user.asyncio_detailed(client=client, id=)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.users.get_user.html" + } + } + }, + "/users/{id}/api-calls": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\nAlternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\nIf the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\nThe API calls are returned in order of creation, with the most recently created API calls first.", + "operationId": "list_api_calls_for_user", + "parameters": [ + { + "description": "The user ID.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode", + "x-scope": [ + "" + ] + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPriceResultsPage", + "x-scope": [ + "" + ] + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + }, + "5XX": { + "$ref": "#/components/responses/Error", + "x-scope": [ + "" + ] + } + }, + "summary": "List API calls for a user.", + "tags": [ + "api-calls" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// ListForUser: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.ListForUser(id, limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListForUserAllPages(id , sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.ListForUser" + }, + "x-python": { + "example": "from kittycad.models import ApiCallWithPriceResultsPage\nfrom kittycad.api.api-calls import list_api_calls_for_user\nfrom kittycad.types import Response\n\nfc: ApiCallWithPriceResultsPage = list_api_calls_for_user.sync(client=client, id=, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR if you need more info (e.g. status_code)\nresponse: Response[ApiCallWithPriceResultsPage] = list_api_calls_for_user.sync_detailed(client=client, id=, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async\nfc: ApiCallWithPriceResultsPage = await list_api_calls_for_user.asyncio(client=client, id=, limit=\"\", page_token=, sort_by=CreatedAtSortMode)\n\n# OR run async with more info\nresponse: Response[ApiCallWithPriceResultsPage] = await list_api_calls_for_user.asyncio_detailed(client=client, id=, limit=\"\", page_token=, sort_by=CreatedAtSortMode)", + "libDocsLink": "https://python.api.docs.kittycad.io/modules/kittycad.api.api-calls.list_api_calls_for_user.html" + } + } } - } }, - "/user": { - "get": { - "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", - "operationId": "get_user_self", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } + "tags": [ + { + "description": "API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/api-calls" }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } + "name": "api-calls" }, - "summary": "Get your user.", - "tags": [ - "users" - ], - "x-go": { - "example": "// GetSelf: Get your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nuser, err := client.User.GetSelf()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelf" + { + "description": "API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/api-tokens" + }, + "name": "api-tokens" + }, + { + "description": "Beta API endpoints. We will not charge for these endpoints while they are in beta.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/beta" + }, + "name": "beta" + }, + { + "description": "CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/file" + }, + "name": "file" + }, + { + "description": "Hidden API endpoints that should not show up in the docs.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/hidden" + }, + "name": "hidden" + }, + { + "description": "Meta information about the API.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/meta" + }, + "name": "meta" + }, + { + "description": "Operations around payments and billing.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/payments" + }, + "name": "payments" + }, + { + "description": "Sessions allow users to call the API from their session cookie in the browser.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/sessions" + }, + "name": "sessions" + }, + { + "description": "A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/users" + }, + "name": "users" } - }, - "options": { - "description": "This is necessary for some preflight requests, specifically DELETE and PUT.", - "operationId": "options_user_self", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "enum": [ - null - ], - "title": "Null", - "type": "string" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "OPTIONS endpoint for users.", - "tags": [ - "hidden" - ] - }, - "put": { - "description": "This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.", - "operationId": "update_user_self", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateUser" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Update your user.", - "tags": [ - "users" - ], - "x-go": { - "example": "// UpdateSelf: Update your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.\nuser, err := client.User.UpdateSelf(body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.UpdateSelf" - } - } - }, - "/user/api-calls": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\nThe API calls are returned in order of creation, with the most recently created API calls first.", - "operationId": "user_list_api_calls", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retrieve the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List API calls for your user.", - "tags": [ - "api-calls" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// UserList: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `UserListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.UserList(limit, pageToken, sortBy)\n\n// - OR -\n\n// UserListAllPages: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `UserList` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.UserListAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.UserList" - } - } - }, - "/user/api-calls/{id}": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.", - "operationId": "get_api_call_for_user", - "parameters": [ - { - "description": "The ID of the API call.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPrice" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get an API call for a user.", - "tags": [ - "api-calls" - ], - "x-go": { - "example": "// GetForUser: Get an API call for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.GetForUser(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetForUser" - } - } - }, - "/user/api-tokens": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\nThe API tokens are returned in order of creation, with the most recently created API tokens first.", - "operationId": "list_api_tokens_for_user", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retrieve the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiTokenResultsPage" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List API tokens for your user.", - "tags": [ - "api-tokens" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// ListForUser: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPITokenResultsPage, err := client.APIToken.ListForUser(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPIToken, err := client.APIToken.ListForUserAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.ListForUser" - } - }, - "post": { - "description": "This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.", - "operationId": "create_api_token_for_user", - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiToken" - } - } - }, - "description": "successful creation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Create a new API token for your user.", - "tags": [ - "api-tokens" - ], - "x-go": { - "example": "// CreateForUser: Create a new API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.\naPIToken, err := client.APIToken.CreateForUser()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.CreateForUser" - } - } - }, - "/user/api-tokens/{token}": { - "delete": { - "description": "This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\nThis endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.", - "operationId": "delete_api_token_for_user", - "parameters": [ - { - "description": "The API token.", - "in": "path", - "name": "token", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "204": { - "description": "successful deletion", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Delete an API token for your user.", - "tags": [ - "api-tokens" - ], - "x-go": { - "example": "// DeleteForUser: Delete an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n//\n// Parameters:\n//\t- `token`: The API token.\nif err := client.APIToken.DeleteForUser(token); err != nil {\n\tpanic(err)\n}", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.DeleteForUser" - } - }, - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.", - "operationId": "get_api_token_for_user", - "parameters": [ - { - "description": "The API token.", - "in": "path", - "name": "token", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiToken" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get an API token for your user.", - "tags": [ - "api-tokens" - ], - "x-go": { - "example": "// GetForUser: Get an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.\n//\n// Parameters:\n//\t- `token`: The API token.\naPIToken, err := client.APIToken.GetForUser(token)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.GetForUser" - } - }, - "options": { - "description": "This is necessary for some preflight requests, specifically DELETE.", - "operationId": "options_api_token_for_user", - "parameters": [ - { - "description": "The API token.", - "in": "path", - "name": "token", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "enum": [ - null - ], - "title": "Null", - "type": "string" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "OPTIONS endpoint for API tokens.", - "tags": [ - "hidden" - ] - } - }, - "/user/extended": { - "get": { - "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", - "operationId": "get_user_self_extended", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExtendedUser" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get extended information about your user.", - "tags": [ - "users" - ], - "x-go": { - "example": "// GetSelfExtended: Get extended information about your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nextendedUser, err := client.User.GetSelfExtended()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelfExtended" - } - } - }, - "/user/file/conversions/{id}": { - "get": { - "description": "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.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.", - "operationId": "get_file_conversion_for_user", - "parameters": [ - { - "description": "The ID of the async operation.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AsyncApiCallOutput" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get a file conversion for your user.", - "tags": [ - "file" - ], - "x-go": { - "example": "// GetConversionForUser: Get a file conversion for your user.\n//\n// 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.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.File.GetConversionForUser(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversionForUser" - } - } - }, - "/user/payment": { - "delete": { - "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.", - "operationId": "delete_payment_information_for_user", - "responses": { - "204": { - "description": "successful deletion", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Delete payment info for your user.", - "tags": [ - "payments" - ], - "x-go": { - "example": "// DeleteInformationForUser: Delete payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.\nif err := client.Payment.DeleteInformationForUser(); err != nil {\n\tpanic(err)\n}", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.DeleteInformationForUser" - } - }, - "get": { - "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.", - "operationId": "get_payment_information_for_user", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get payment info about your user.", - "tags": [ - "payments" - ], - "x-go": { - "example": "// GetInformationForUser: Get payment info about your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.\ncustomer, err := client.Payment.GetInformationForUser()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.GetInformationForUser" - } - }, - "options": { - "description": "This is necessary for some preflight requests, specifically DELETE and PUT.", - "operationId": "options_payment_information_for_user", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "enum": [ - null - ], - "title": "Null", - "type": "string" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "OPTIONS endpoint for user payment information.", - "tags": [ - "hidden" - ] - }, - "post": { - "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.", - "operationId": "create_payment_information_for_user", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BillingInfo" - } - } - }, - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - }, - "description": "successful creation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Create payment info for your user.", - "tags": [ - "payments" - ], - "x-go": { - "example": "// CreateInformationForUser: Create payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.\ncustomer, err := client.Payment.CreateInformationForUser(body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.CreateInformationForUser" - } - }, - "put": { - "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.", - "operationId": "update_payment_information_for_user", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BillingInfo" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Update payment info for your user.", - "tags": [ - "payments" - ], - "x-go": { - "example": "// UpdateInformationForUser: Update payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.\ncustomer, err := client.Payment.UpdateInformationForUser(body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.UpdateInformationForUser" - } - } - }, - "/user/payment/intent": { - "post": { - "description": "This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.", - "operationId": "create_payment_intent_for_user", - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaymentIntent" - } - } - }, - "description": "successful creation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Create a payment intent for your user.", - "tags": [ - "payments", - "hidden" - ], - "x-go": { - "example": "// CreateIntentForUser: Create a payment intent for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.\npaymentIntent, err := client.Payment.CreateIntentForUser()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.CreateIntentForUser" - } - } - }, - "/user/payment/invoices": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.", - "operationId": "list_invoices_for_user", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/Invoice" - }, - "title": "Array_of_Invoice", - "type": "array" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List invoices for your user.", - "tags": [ - "payments" - ], - "x-go": { - "example": "// ListInvoicesForUser: List invoices for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.\nInvoice, err := client.Payment.ListInvoicesForUser()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.ListInvoicesForUser" - } - } - }, - "/user/payment/methods": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.", - "operationId": "list_payment_methods_for_user", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "$ref": "#/components/schemas/PaymentMethod" - }, - "title": "Array_of_PaymentMethod", - "type": "array" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List payment methods for your user.", - "tags": [ - "payments" - ], - "x-go": { - "example": "// ListMethodsForUser: List payment methods for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.\nPaymentMethod, err := client.Payment.ListMethodsForUser()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.ListMethodsForUser" - } - } - }, - "/user/payment/methods/{id}": { - "delete": { - "description": "This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.", - "operationId": "delete_payment_method_for_user", - "parameters": [ - { - "description": "The ID of the payment method.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "204": { - "description": "successful deletion", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Delete a payment method for your user.", - "tags": [ - "payments", - "hidden" - ], - "x-go": { - "example": "// DeleteMethodForUser: Delete a payment method for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.\n//\n// Parameters:\n//\t- `id`: The ID of the payment method.\nif err := client.Payment.DeleteMethodForUser(id); err != nil {\n\tpanic(err)\n}", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.DeleteMethodForUser" - } - }, - "options": { - "description": "This is necessary for some preflight requests, specifically DELETE.", - "operationId": "options_payment_methods_for_user", - "parameters": [ - { - "description": "The ID of the payment method.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "enum": [ - null - ], - "title": "Null", - "type": "string" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "OPTIONS endpoint for user payment methods.", - "tags": [ - "hidden" - ] - } - }, - "/user/session/{token}": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.", - "operationId": "get_session_for_user", - "parameters": [ - { - "description": "The API token.", - "in": "path", - "name": "token", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get a session for your user.", - "tags": [ - "sessions" - ], - "x-go": { - "example": "// GetForUser: Get a session for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.\n//\n// Parameters:\n//\t- `token`: The API token.\nsession, err := client.Session.GetForUser(token)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#SessionService.GetForUser" - } - } - }, - "/users": { - "get": { - "description": "This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.", - "operationId": "list_users", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retrieve the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserResultsPage" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List users.", - "tags": [ - "users" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// List: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\nuserResultsPage, err := client.User.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nUser, err := client.User.ListAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.List" - } - } - }, - "/users-extended": { - "get": { - "description": "This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.", - "operationId": "list_users_extended", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retrieve the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExtendedUserResultsPage" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List users with extended information.", - "tags": [ - "users" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// ListExtended: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListExtendedAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\nextendedUserResultsPage, err := client.User.ListExtended(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListExtendedAllPages: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `ListExtended` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nExtendedUser, err := client.User.ListExtendedAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.ListExtended" - } - } - }, - "/users-extended/{id}": { - "get": { - "description": "To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.\nAlternatively, to get information about the authenticated user, use `/user/extended` endpoint.\nTo get information about any KittyCAD user, you must be a KittyCAD employee.", - "operationId": "get_user_extended", - "parameters": [ - { - "description": "The user ID.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ExtendedUser" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get extended information about a user.", - "tags": [ - "users" - ], - "x-go": { - "example": "// GetExtended: Get extended information about a user.\n//\n// To get information about yourself, use `/users-extended/me` as the endpoint. By doing so you will get the user information for the authenticated user.\n// Alternatively, to get information about the authenticated user, use `/user/extended` endpoint.\n// To get information about any KittyCAD user, you must be a KittyCAD employee.\n//\n// Parameters:\n//\t- `id`: The user ID.\nextendedUser, err := client.User.GetExtended(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetExtended" - } - } - }, - "/users/{id}": { - "get": { - "description": "To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.\nAlternatively, to get information about the authenticated user, use `/user` endpoint.\nTo get information about any KittyCAD user, you must be a KittyCAD employee.", - "operationId": "get_user", - "parameters": [ - { - "description": "The user ID.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get a user.", - "tags": [ - "users" - ], - "x-go": { - "example": "// Get: Get a user.\n//\n// To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.\n// Alternatively, to get information about the authenticated user, use `/user` endpoint.\n// To get information about any KittyCAD user, you must be a KittyCAD employee.\n//\n// Parameters:\n//\t- `id`: The user ID.\nuser, err := client.User.Get(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.Get" - } - } - }, - "/users/{id}/api-calls": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\nAlternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\nIf the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\nThe API calls are returned in order of creation, with the most recently created API calls first.", - "operationId": "list_api_calls_for_user", - "parameters": [ - { - "description": "The user ID.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retrieve the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" - } - } - }, - "description": "successful operation", - "headers": { - "Access-Control-Allow-Credentials": { - "description": "Access-Control-Allow-Credentials header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Headers": { - "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Methods": { - "description": "Access-Control-Allow-Methods header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - }, - "Access-Control-Allow-Origin": { - "description": "Access-Control-Allow-Origin header.", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "List API calls for a user.", - "tags": [ - "api-calls" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// ListForUser: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.ListForUser(id, limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListForUserAllPages(id , sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.ListForUser" - } - } - } - }, - "tags": [ - { - "description": "API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/api-calls" - }, - "name": "api-calls" - }, - { - "description": "API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/api-tokens" - }, - "name": "api-tokens" - }, - { - "description": "Beta API endpoints. We will not charge for these endpoints while they are in beta.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/beta" - }, - "name": "beta" - }, - { - "description": "CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/file" - }, - "name": "file" - }, - { - "description": "Hidden API endpoints that should not show up in the docs.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/hidden" - }, - "name": "hidden" - }, - { - "description": "Meta information about the API.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/meta" - }, - "name": "meta" - }, - { - "description": "Operations around payments and billing.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/payments" - }, - "name": "payments" - }, - { - "description": "Sessions allow users to call the API from their session cookie in the browser.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/sessions" - }, - "name": "sessions" - }, - { - "description": "A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves.", - "externalDocs": { - "url": "https://docs.kittycad.io/api/users" - }, - "name": "users" - } - ] + ] } \ No newline at end of file