kittycad.types
Contains some shared types for properties
Classes
|
Contains information for file uploads |
|
A response from an endpoint |
|
- 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]
- 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 doFoo[int]
- there, withcls=Foo
andparams=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]
- __init__(status_code, content, headers, parsed)[source]
Method generated by attrs for class Response.
-
headers:
MutableMapping
[str
,str
][source]