thundra.button package¶
Submodules¶
thundra.button.registry module¶
- class thundra.button.registry.ButtonEventData(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]-
expiration:
datetime
¶
-
id:
str
¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'expiration': FieldInfo(annotation=datetime, required=True), 'id': FieldInfo(annotation=str, required=True), 'on_click': FieldInfo(annotation=Callable[list, NoneType], required=True), 'params_type': FieldInfo(annotation=Union[Type[~_ParamsButtonEvent], NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
-
on_click:
Callable
[[TypeVar
(_ParamsButtonEvent
, bound=BaseModel
)],None
]¶
-
params_type:
Optional
[Type
[TypeVar
(_ParamsButtonEvent
, bound=BaseModel
)]]¶
-
expiration:
thundra.button.types module¶
thundra.button.v1 module¶
- class thundra.button.v1.CopyButton(**data)[source]¶
Bases:
BaseModel
- copy_code: str¶
- display_text: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'copy_code': FieldInfo(annotation=str, required=True), 'display_text': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class thundra.button.v1.EmptyParams(**data)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class thundra.button.v1.ListButton(**data)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'sections': FieldInfo(annotation=List[Section], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- sections: List[Section]¶
- title: str¶
- class thundra.button.v1.QuickReply(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- display_text: str¶
- expiration: datetime¶
- id: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'display_text': FieldInfo(annotation=str, required=True), 'expiration': FieldInfo(annotation=datetime, required=False, default_factory=<lambda>), 'id': FieldInfo(annotation=str, required=False, default_factory=<lambda>), 'on_click': FieldInfo(annotation=Union[Callable[list, NoneType], Callable[list, NoneType]], required=True), 'params': FieldInfo(annotation=~_ParamsButtonEvent, required=False, default=EmptyParams())}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- on_click: Callable[[_ParamsButtonEvent], None] | Callable[[], None]¶
- params: _ParamsButtonEvent¶
- class thundra.button.v1.Row(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- description: str¶
- header: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=str, required=True), 'header': FieldInfo(annotation=str, required=True), 'params': FieldInfo(annotation=Union[~_ParamsButtonEvent, NoneType], required=False, default=None), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- params: Optional[_ParamsButtonEvent]¶
- title: str¶
- class thundra.button.v1.Section(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- expiration: datetime¶
- highlight_label: str¶
- id: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'expiration': FieldInfo(annotation=datetime, required=False, default_factory=<lambda>), 'highlight_label': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=False, default_factory=<lambda>), 'on_selected': FieldInfo(annotation=Union[Callable[list, NoneType], NoneType], required=False, default=None), 'rows': FieldInfo(annotation=List[Row], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- on_selected: Optional[Callable[[_ParamsButtonEvent], None]]¶
- rows: List[Row[_ParamsButtonEvent]]¶
- title: str¶
thundra.button.v2 module¶
- class thundra.button.v2.EmptyParams(**data)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class thundra.button.v2.ListButtonV2(**data)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'sections': FieldInfo(annotation=List[SectionV2], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- sections: List[SectionV2]¶
- title: str¶
- class thundra.button.v2.QuickReplyV2(**data)[source]¶
Bases:
ABC
,BaseModel
,Generic
[_ParamsButtonEvent
],EventType
- display_text: str¶
- event_id: ClassVar[str]¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'display_text': FieldInfo(annotation=str, required=True), 'params': FieldInfo(annotation=~_ParamsButtonEvent, required=False, default=EmptyParams())}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- params: _ParamsButtonEvent¶
- class thundra.button.v2.RowV2(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- description: str¶
- header: str¶
- id: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=str, required=True), 'header': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=False, default=''), 'params': FieldInfo(annotation=~_ParamsButtonEvent, required=False, default=EmptyParams()), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- params: _ParamsButtonEvent¶
- title: str¶
- class thundra.button.v2.SectionV2(**data)[source]¶
Bases:
ABC
,BaseModel
,Generic
[_ParamsButtonEvent
],EventType
- event_id: ClassVar[str]¶
- highlight_label: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'highlight_label': FieldInfo(annotation=str, required=True), 'rows': FieldInfo(annotation=List[RowV2], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- rows: List[RowV2[_ParamsButtonEvent]]¶
- title: str¶
Module contents¶
- class thundra.button.CopyButton(**data)[source]¶
Bases:
BaseModel
- copy_code: str¶
- display_text: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'copy_code': FieldInfo(annotation=str, required=True), 'display_text': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class thundra.button.ListButton(**data)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'sections': FieldInfo(annotation=List[Section], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- sections: List[Section]¶
- title: str¶
- class thundra.button.ListButtonV2(**data)[source]¶
Bases:
BaseModel
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'sections': FieldInfo(annotation=List[SectionV2], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- sections: List[SectionV2]¶
- title: str¶
- class thundra.button.QuickReply(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- display_text: str¶
- expiration: datetime¶
- id: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'display_text': FieldInfo(annotation=str, required=True), 'expiration': FieldInfo(annotation=datetime, required=False, default_factory=<lambda>), 'id': FieldInfo(annotation=str, required=False, default_factory=<lambda>), 'on_click': FieldInfo(annotation=Union[Callable[list, NoneType], Callable[list, NoneType]], required=True), 'params': FieldInfo(annotation=~_ParamsButtonEvent, required=False, default=EmptyParams())}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- on_click: Callable[[_ParamsButtonEvent], None] | Callable[[], None]¶
- params: _ParamsButtonEvent¶
- class thundra.button.QuickReplyV2(**data)[source]¶
Bases:
ABC
,BaseModel
,Generic
[_ParamsButtonEvent
],EventType
- display_text: str¶
- event_id: ClassVar[str]¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'display_text': FieldInfo(annotation=str, required=True), 'params': FieldInfo(annotation=~_ParamsButtonEvent, required=False, default=EmptyParams())}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- params: _ParamsButtonEvent¶
- class thundra.button.Row(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- description: str¶
- header: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=str, required=True), 'header': FieldInfo(annotation=str, required=True), 'params': FieldInfo(annotation=Union[~_ParamsButtonEvent, NoneType], required=False, default=None), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- params: Optional[_ParamsButtonEvent]¶
- title: str¶
- class thundra.button.RowV2(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- description: str¶
- header: str¶
- id: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=str, required=True), 'header': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=False, default=''), 'params': FieldInfo(annotation=~_ParamsButtonEvent, required=False, default=EmptyParams()), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- params: _ParamsButtonEvent¶
- title: str¶
- class thundra.button.Section(**data)[source]¶
Bases:
BaseModel
,Generic
[_ParamsButtonEvent
]- expiration: datetime¶
- highlight_label: str¶
- id: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'expiration': FieldInfo(annotation=datetime, required=False, default_factory=<lambda>), 'highlight_label': FieldInfo(annotation=str, required=True), 'id': FieldInfo(annotation=str, required=False, default_factory=<lambda>), 'on_selected': FieldInfo(annotation=Union[Callable[list, NoneType], NoneType], required=False, default=None), 'rows': FieldInfo(annotation=List[Row], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- on_selected: Optional[Callable[[_ParamsButtonEvent], None]]¶
- rows: List[Row[_ParamsButtonEvent]]¶
- title: str¶
- class thundra.button.SectionV2(**data)[source]¶
Bases:
ABC
,BaseModel
,Generic
[_ParamsButtonEvent
],EventType
- event_id: ClassVar[str]¶
- highlight_label: str¶
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'highlight_label': FieldInfo(annotation=str, required=True), 'rows': FieldInfo(annotation=List[RowV2], required=True), 'title': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- rows: List[RowV2[_ParamsButtonEvent]]¶
- title: str¶