kittycad.types

Contains some shared types for properties

Classes

File(payload[, file_name, mime_type])

Contains information for file uploads

Response(status_code, content, headers, parsed)

A response from an endpoint

Unset()

class kittycad.types.File(payload, file_name=None, mime_type=None)[source][source]

Contains information for file uploads

Method generated by attrs for class File.

__annotations__ = {'file_name': typing.Optional[str], 'mime_type': typing.Optional[str], 'payload': typing.Union[typing.BinaryIO, typing.TextIO]}[source]
__attrs_attrs__ = (Attribute(name='payload', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Union[typing.BinaryIO, typing.TextIO], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='payload'), Attribute(name='file_name', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Optional[str], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='file_name'), Attribute(name='mime_type', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Optional[str], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='mime_type'))[source]
__dict__ = mappingproxy({'__module__': 'kittycad.types', '__annotations__': {'payload': typing.Union[typing.BinaryIO, typing.TextIO], 'file_name': typing.Optional[str], 'mime_type': typing.Optional[str]}, '__doc__': 'Contains information for file uploads', 'to_tuple': <function File.to_tuple>, '__dict__': <attribute '__dict__' of 'File' objects>, '__weakref__': <attribute '__weakref__' of 'File' objects>, '__attrs_attrs__': (Attribute(name='payload', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Union[typing.BinaryIO, typing.TextIO], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='payload'), Attribute(name='file_name', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Optional[str], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='file_name'), Attribute(name='mime_type', default=None, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Optional[str], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='mime_type')), '__repr__': <function File.__repr__>, '__eq__': <function File.__eq__>, '__ne__': <function File.__ne__>, '__lt__': <function File.__lt__>, '__le__': <function File.__le__>, '__gt__': <function File.__gt__>, '__ge__': <function File.__ge__>, '__hash__': None, '__init__': <function File.__init__>, '__match_args__': ('payload', 'file_name', 'mime_type')})[source]
__eq__(other)[source]

Method generated by attrs for class File.

__ge__(other)[source]

Method generated by attrs for class File.

__gt__(other)[source]

Method generated by attrs for class File.

__hash__ = None[source]
__init__(payload, file_name=None, mime_type=None)[source]

Method generated by attrs for class File.

__le__(other)[source]

Method generated by attrs for class File.

__lt__(other)[source]

Method generated by attrs for class File.

__match_args__ = ('payload', 'file_name', 'mime_type')[source]
__module__ = 'kittycad.types'[source]
__ne__(other)[source]

Method generated by attrs for class File.

__repr__()[source]

Method generated by attrs for class File.

file_name: Optional[str][source]
mime_type: Optional[str][source]
payload: Union[BinaryIO, TextIO][source]
to_tuple()[source][source]

Return a tuple representation that httpx will accept for multipart/form-data

Return type:

Tuple[Optional[str], Union[BinaryIO, TextIO], Optional[str]]

class kittycad.types.Response(status_code, content, headers, parsed)[source][source]

A response from an endpoint

Method generated by attrs for class Response.

__annotations__ = {'content': <class 'bytes'>, 'headers': typing.MutableMapping[str, str], 'parsed': typing.Optional[~T], 'status_code': <class 'int'>}[source]
__attrs_attrs__ = (Attribute(name='status_code', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=<class 'int'>, converter=None, kw_only=False, inherited=False, on_setattr=None, alias='status_code'), Attribute(name='content', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=<class 'bytes'>, converter=None, kw_only=False, inherited=False, on_setattr=None, alias='content'), Attribute(name='headers', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.MutableMapping[str, str], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='headers'), Attribute(name='parsed', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Optional[~T], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='parsed'))[source]
__class_getitem__()[source]

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ....

__dict__ = mappingproxy({'__module__': 'kittycad.types', '__annotations__': {'status_code': <class 'int'>, 'content': <class 'bytes'>, 'headers': typing.MutableMapping[str, str], 'parsed': typing.Optional[~T]}, '__doc__': 'A response from an endpoint', '__orig_bases__': (typing.Generic[~T],), '__dict__': <attribute '__dict__' of 'Response' objects>, '__weakref__': <attribute '__weakref__' of 'Response' objects>, '__parameters__': (~T,), '__attrs_attrs__': (Attribute(name='status_code', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=<class 'int'>, converter=None, kw_only=False, inherited=False, on_setattr=None, alias='status_code'), Attribute(name='content', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=<class 'bytes'>, converter=None, kw_only=False, inherited=False, on_setattr=None, alias='content'), Attribute(name='headers', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.MutableMapping[str, str], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='headers'), Attribute(name='parsed', default=NOTHING, validator=None, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=typing.Optional[~T], converter=None, kw_only=False, inherited=False, on_setattr=None, alias='parsed')), '__repr__': <function Response.__repr__>, '__eq__': <function Response.__eq__>, '__ne__': <function Response.__ne__>, '__lt__': <function Response.__lt__>, '__le__': <function Response.__le__>, '__gt__': <function Response.__gt__>, '__ge__': <function Response.__ge__>, '__hash__': None, '__init__': <function Response.__init__>, '__match_args__': ('status_code', 'content', 'headers', 'parsed')})[source]
__eq__(other)[source]

Method generated by attrs for class Response.

__ge__(other)[source]

Method generated by attrs for class Response.

__gt__(other)[source]

Method generated by attrs for class Response.

__hash__ = None[source]
__init__(status_code, content, headers, parsed)[source]

Method generated by attrs for class Response.

__init_subclass__()[source]

Function to initialize subclasses.

__le__(other)[source]

Method generated by attrs for class Response.

__lt__(other)[source]

Method generated by attrs for class Response.

__match_args__ = ('status_code', 'content', 'headers', 'parsed')[source]
__module__ = 'kittycad.types'[source]
__ne__(other)[source]

Method generated by attrs for class Response.

__orig_bases__ = (typing.Generic[~T],)[source]
__parameters__ = (~T,)[source]
__repr__()[source]

Method generated by attrs for class Response.

content: bytes[source]
headers: MutableMapping[str, str][source]
parsed: Optional[TypeVar(T)][source]
status_code: int[source]