flexmeasures.data.schemas.automations
Classes
- class flexmeasures.data.schemas.automations.AutomationCreationSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
Request schema for creating an automation (the asset comes from the URL path).
The parameters are validated separately, by the schema matching the automation type.
- class flexmeasures.data.schemas.automations.AutomationIdField(*args, **kwargs)
Field that deserializes to an Automation and serializes back to an integer.
- _deserialize(value, attr, obj, **kwargs) Automation
Turn an automation id into an Automation.
- _serialize(automation, attr, data, **kwargs)
Turn an Automation into an automation id.
- class flexmeasures.data.schemas.automations.AutomationSchema(*args, **kwargs)
Automation schema, with validations.
- class Meta
- model
alias of
Automation
- opts: LoadInstanceMixin.Opts = <flask_marshmallow.sqla.SQLAlchemySchemaOpts object>
- class flexmeasures.data.schemas.automations.AutomationUpdateSchema(*, only: Sequence[str] | AbstractSet[str] | None = None, exclude: Sequence[str] | AbstractSet[str] = (), many: bool | None = None, load_only: Sequence[str] | AbstractSet[str] = (), dump_only: Sequence[str] | AbstractSet[str] = (), partial: bool | Sequence[str] | AbstractSet[str] | None = None, unknown: Literal['exclude', 'include', 'raise'] | None = None)
Request schema for updating an automation’s name, cron string and/or activation status.
- class flexmeasures.data.schemas.automations.CronField(*args, **kwargs)
Field that validates a cron string (e.g. “0 6 * * *”).
- _deserialize(value, attr, obj, **kwargs) str
Deserialize value. Concrete
Fieldclasses should implement this method.- Parameters:
value – The value to be deserialized.
attr – The attribute/key in data to be deserialized.
data – The raw input data passed to the Schema.load <marshmallow.Schema.load>.
kwargs – Field-specific keyword arguments.
- Raises:
ValidationError – In case of formatting or validation failure.
- Returns:
The deserialized value.
Changed in version 3.0.0: Added
**kwargsto signature.