# {py:mod}`labthings_fastapi.descriptors.property` ```{py:module} labthings_fastapi.descriptors.property ``` ```{autodoc2-docstring} labthings_fastapi.descriptors.property :allowtitles: ``` ## Module Contents ### Classes ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`ThingProperty ` - ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty :summary: ``` * - {py:obj}`ThingSetting ` - ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingSetting :summary: ``` ```` ### API `````{py:class} ThingProperty(model: type, initial_value: typing.Any = None, readonly: bool = False, observable: bool = False, description: typing.Optional[str] = None, title: typing.Optional[str] = None, getter: typing.Optional[typing.Callable] = None, setter: typing.Optional[typing.Callable] = None) :canonical: labthings_fastapi.descriptors.property.ThingProperty ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty ``` ````{py:attribute} model :canonical: labthings_fastapi.descriptors.property.ThingProperty.model :type: type[pydantic.BaseModel] :value: > None ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.model ``` ```` ````{py:attribute} readonly :canonical: labthings_fastapi.descriptors.property.ThingProperty.readonly :type: bool :value: > False ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.readonly ``` ```` ````{py:method} __init__(model: type, initial_value: typing.Any = None, readonly: bool = False, observable: bool = False, description: typing.Optional[str] = None, title: typing.Optional[str] = None, getter: typing.Optional[typing.Callable] = None, setter: typing.Optional[typing.Callable] = None) :canonical: labthings_fastapi.descriptors.property.ThingProperty.__init__ ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.__init__ ``` ```` ````{py:method} __set_name__(owner, name: str) :canonical: labthings_fastapi.descriptors.property.ThingProperty.__set_name__ ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.__set_name__ ``` ```` ````{py:property} title :canonical: labthings_fastapi.descriptors.property.ThingProperty.title ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.title ``` ```` ````{py:property} description :canonical: labthings_fastapi.descriptors.property.ThingProperty.description ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.description ``` ```` ````{py:method} __get__(obj, type=None) -> typing.Any :canonical: labthings_fastapi.descriptors.property.ThingProperty.__get__ ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.__get__ ``` ```` ````{py:method} __set__(obj, value) :canonical: labthings_fastapi.descriptors.property.ThingProperty.__set__ ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.__set__ ``` ```` ````{py:method} _observers_set(obj) :canonical: labthings_fastapi.descriptors.property.ThingProperty._observers_set ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty._observers_set ``` ```` ````{py:method} emit_changed_event(obj: labthings_fastapi.thing.Thing, value: typing.Any) -> None :canonical: labthings_fastapi.descriptors.property.ThingProperty.emit_changed_event ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.emit_changed_event ``` ```` ````{py:method} emit_changed_event_async(obj: labthings_fastapi.thing.Thing, value: typing.Any) :canonical: labthings_fastapi.descriptors.property.ThingProperty.emit_changed_event_async :async: ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.emit_changed_event_async ``` ```` ````{py:property} name :canonical: labthings_fastapi.descriptors.property.ThingProperty.name ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.name ``` ```` ````{py:method} add_to_fastapi(app: fastapi.FastAPI, thing: labthings_fastapi.thing.Thing) :canonical: labthings_fastapi.descriptors.property.ThingProperty.add_to_fastapi ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.add_to_fastapi ``` ```` ````{py:method} property_affordance(thing: labthings_fastapi.thing.Thing, path: typing.Optional[str] = None) -> labthings_fastapi.thing_description.model.PropertyAffordance :canonical: labthings_fastapi.descriptors.property.ThingProperty.property_affordance ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.property_affordance ``` ```` ````{py:method} getter(func: typing.Callable) -> typing_extensions.Self :canonical: labthings_fastapi.descriptors.property.ThingProperty.getter ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.getter ``` ```` ````{py:method} setter(func: typing.Callable) -> typing_extensions.Self :canonical: labthings_fastapi.descriptors.property.ThingProperty.setter ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingProperty.setter ``` ```` ````` `````{py:class} ThingSetting(model: type, initial_value: typing.Any = None, readonly: bool = False, observable: bool = False, description: typing.Optional[str] = None, title: typing.Optional[str] = None, getter: typing.Optional[typing.Callable] = None, setter: typing.Optional[typing.Callable] = None) :canonical: labthings_fastapi.descriptors.property.ThingSetting Bases: {py:obj}`labthings_fastapi.descriptors.property.ThingProperty` ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingSetting ``` ````{py:method} __set__(obj, value) :canonical: labthings_fastapi.descriptors.property.ThingSetting.__set__ ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingSetting.__set__ ``` ```` ````{py:method} set_without_emit(obj, value) :canonical: labthings_fastapi.descriptors.property.ThingSetting.set_without_emit ```{autodoc2-docstring} labthings_fastapi.descriptors.property.ThingSetting.set_without_emit ``` ```` `````