kittycad.types.Response
- class kittycad.types.Response(status_code, content, headers, parsed)[source][source]
Bases:
Generic
[T
]A response from an endpoint
Method generated by attrs for class Response.
- __init__(status_code, content, headers, parsed)[source]
Method generated by attrs for class Response.
Methods
__init__
(status_code, content, headers, parsed)Method generated by attrs for class Response.
Attributes
- __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]
- classmethod __class_getitem__(params)[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(Generic[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.
- classmethod __init_subclass__(*args, **kwargs)[source]
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
headers:
MutableMapping
[str
,str
][source]