seguro.commands.notifier.model¶
Classes
|
|
|
|
|
|
|
|
|
- class seguro.commands.notifier.model.AttachmentBase(*, inline=False, expires=datetime.timedelta(days=7))[source]¶
Bases:
BaseModel
,ABC
- Parameters:
inline (bool)
expires (timedelta)
- expires: timedelta¶
- inline: bool¶
- 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]] = {'expires': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(days=7)), 'inline': FieldInfo(annotation=bool, required=False, default=False)}¶
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 seguro.commands.notifier.model.FileAttachment(*, inline=False, expires=datetime.timedelta(days=7), file)[source]¶
Bases:
AttachmentBase
- Parameters:
inline (bool)
expires (timedelta)
file (Path)
- file: Path¶
- 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]] = {'expires': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(days=7)), 'file': FieldInfo(annotation=Path, required=True, metadata=[PathType(path_type='file')]), 'inline': FieldInfo(annotation=bool, required=False, default=False)}¶
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 seguro.commands.notifier.model.Notification(*, body, title='', notify_type='info', body_format='text', attachments=[], tag='all')[source]¶
Bases:
BaseModel
- Parameters:
body (str)
title (str)
notify_type (str)
body_format (str)
attachments (list[StoreAttachment | RawAttachment | FileAttachment])
tag (str | list[str | list[str]])
- attachments: list[StoreAttachment | RawAttachment | FileAttachment]¶
- body: str¶
- body_format: 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]] = {'attachments': FieldInfo(annotation=list[Union[StoreAttachment, RawAttachment, FileAttachment]], required=False, default=[]), 'body': FieldInfo(annotation=str, required=True), 'body_format': FieldInfo(annotation=str, required=False, default='text'), 'notify_type': FieldInfo(annotation=str, required=False, default='info'), 'tag': FieldInfo(annotation=Union[str, list[Union[str, list[str]]]], required=False, default='all'), 'title': FieldInfo(annotation=str, required=False, default='')}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- notify_type: str¶
- tag: str | list[str | list[str]]¶
- title: str¶
- class seguro.commands.notifier.model.RawAttachment(*, inline=False, expires=datetime.timedelta(days=7), name, contents)[source]¶
Bases:
AttachmentBase
- Parameters:
inline (bool)
expires (timedelta)
name (str)
contents (bytes)
- contents: bytes¶
- 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]] = {'contents': FieldInfo(annotation=bytes, required=True), 'expires': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(days=7)), 'inline': FieldInfo(annotation=bool, required=False, default=False), 'name': 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.
- name: str¶
- class seguro.commands.notifier.model.StoreAttachment(*, inline=False, expires=datetime.timedelta(days=7), object_name)[source]¶
Bases:
AttachmentBase
- Parameters:
inline (bool)
expires (timedelta)
object_name (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]] = {'expires': FieldInfo(annotation=timedelta, required=False, default=datetime.timedelta(days=7)), 'inline': FieldInfo(annotation=bool, required=False, default=False), 'object_name': 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.
- object_name: str¶