TaskOptions constructor
TaskOptions({
- DeliverySchedule? schedule,
- int? dispatchDeadlineSeconds,
- String? id,
- Map<
String, String> ? headers, - TaskOptionsExperimental? experimental,
Creates task options with the specified configuration.
Implementation
TaskOptions({
this.schedule,
this.dispatchDeadlineSeconds,
this.id,
this.headers,
this.experimental,
}) {
// Validate dispatchDeadlineSeconds range
if (dispatchDeadlineSeconds != null &&
(dispatchDeadlineSeconds! < 15 || dispatchDeadlineSeconds! > 1800)) {
throw FirebaseFunctionsAdminException(
FunctionsClientErrorCode.invalidArgument,
'dispatchDeadlineSeconds must be between 15 and 1800 seconds.',
);
}
// Validate task ID format
if (id != null && !isValidTaskId(id)) {
throw FirebaseFunctionsAdminException(
FunctionsClientErrorCode.invalidArgument,
'id can contain only letters ([A-Za-z]), numbers ([0-9]), '
'hyphens (-), or underscores (_). The maximum length is 500 characters.',
);
}
}