schedule method

Future<DynamiteResponse<TextToImageApiScheduleResponseApplicationJson, void>> schedule({
  1. required String input,
  2. required String appId,
  3. String? identifier,
  4. int? numberOfImages,
  5. bool? oCSAPIRequest,
})

This endpoint allows scheduling a text to image task.

Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.

Parameters:

  • input Input text.
  • appId ID of the app that will execute the task.
  • identifier An arbitrary identifier for the task. Defaults to ''.
  • numberOfImages The number of images to generate. Defaults to 8.
  • oCSAPIRequest Required to be true for the API request to pass. Defaults to true.

Status codes:

  • 200: Task scheduled successfully
  • 412: Scheduling task is not possible
  • 500

See:

  • scheduleRaw for an experimental operation that returns a DynamiteRawResponse that can be serialized.

Implementation

Future<_i1.DynamiteResponse<TextToImageApiScheduleResponseApplicationJson, void>> schedule({
  required String input,
  required String appId,
  String? identifier,
  int? numberOfImages,
  bool? oCSAPIRequest,
}) async {
  final rawResponse = scheduleRaw(
    input: input,
    appId: appId,
    identifier: identifier,
    numberOfImages: numberOfImages,
    oCSAPIRequest: oCSAPIRequest,
  );

  return rawResponse.future;
}