schedule method
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:
inputInput text.appIdID of the app that will execute the task.identifierAn arbitrary identifier for the task. Defaults to"".numberOfImagesThe number of images to generate. Defaults to8.oCSAPIRequestRequired to be true for the API request to pass. Defaults totrue.
Status codes:
- 200: Task scheduled successfully
- 412: Scheduling task is not possible
- 500
See:
- $schedule_Request for the request send by this method.
- $schedule_Serializer for a converter to parse the
Responsefrom an executed request.
Implementation
Future<_i1.DynamiteResponse<TextToImageApiScheduleResponseApplicationJson, void>> schedule({
required String input,
required String appId,
String? identifier,
int? numberOfImages,
bool? oCSAPIRequest,
}) async {
final _request = $schedule_Request(
input: input,
appId: appId,
identifier: identifier,
numberOfImages: numberOfImages,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $schedule_Serializer();
final _rawResponse = await _i1.ResponseConverter<TextToImageApiScheduleResponseApplicationJson, void>(_serializer)
.convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}