Automation class
Automation defines scheduled or triggered actions.
Constructors
- Automation({required String jobId, required String name, String? description, required AutomationTriggerType trigger, String? condition, required String action, bool enabled = true, ScheduleMeta? scheduleMeta, String idempotencyKeyStrategy = 'time-based', RetryPolicy retryPolicy = const RetryPolicy(), String? workspaceId, required DateTime createdAt, required DateTime updatedAt, DateTime? lastRunAt, DateTime? nextRunAt})
-
const
-
Automation.fromJson(Map<
String, dynamic> json) -
Create from JSON.
factory
Properties
- action → String
-
Action to execute.
final
- condition → String?
-
Condition expression for condition-based triggers.
final
- createdAt → DateTime
-
When the automation was created.
final
- description → String?
-
Description of what this automation does.
final
- enabled → bool
-
Whether the automation is enabled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- idempotencyKeyStrategy → String
-
Strategy for generating idempotency keys.
final
- isReadyToRun → bool
-
Check if automation is ready to run.
no setter
- isScheduled → bool
-
Check if this is a scheduled automation.
no setter
- jobId → String
-
Unique job identifier.
final
- lastRunAt → DateTime?
-
When the automation last ran.
final
- name → String
-
Human-readable name.
final
- nextRunAt → DateTime?
-
When the automation will next run.
final
- retryPolicy → RetryPolicy
-
Retry policy.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scheduleMeta → ScheduleMeta?
-
Schedule metadata for scheduled triggers.
final
- trigger → AutomationTriggerType
-
Trigger type.
final
- updatedAt → DateTime
-
When the automation was last updated.
final
- workspaceId → String?
-
Workspace ID.
final
Methods
-
copyWith(
{String? jobId, String? name, String? description, AutomationTriggerType? trigger, String? condition, String? action, bool? enabled, ScheduleMeta? scheduleMeta, String? idempotencyKeyStrategy, RetryPolicy? retryPolicy, String? workspaceId, DateTime? createdAt, DateTime? updatedAt, DateTime? lastRunAt, DateTime? nextRunAt}) → Automation - Create a copy with modifications.
-
disable(
) → Automation - Disable this automation.
-
enable(
) → Automation - Enable this automation.
-
markRun(
{DateTime? nextRun}) → Automation - Mark as run.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Convert to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited