scheduleRun method

Future<ScheduleRunResult> scheduleRun({
  1. required String projectArn,
  2. required ScheduleRunTest test,
  3. String? appArn,
  4. ScheduleRunConfiguration? configuration,
  5. String? devicePoolArn,
  6. DeviceSelectionConfiguration? deviceSelectionConfiguration,
  7. ExecutionConfiguration? executionConfiguration,
  8. String? name,
})

Schedules a run.

May throw ArgumentException. May throw NotFoundException. May throw LimitExceededException. May throw IdempotencyException. May throw ServiceAccountException.

Parameter projectArn : The ARN of the project for the run to be scheduled.

Parameter test : Information about the test for the run to be scheduled.

Parameter appArn : The ARN of an application package to run tests against, created with CreateUpload. See ListUploads.

Parameter configuration : Information about the settings for the run to be scheduled.

Parameter devicePoolArn : The ARN of the device pool for the run to be scheduled.

Parameter deviceSelectionConfiguration : The filter criteria used to dynamically select a set of devices for a test run and the maximum number of devices to be included in the run.

Either devicePoolArn or deviceSelectionConfiguration is required in a request.

Parameter executionConfiguration : Specifies configuration information about a test run, such as the execution timeout (in minutes).

Parameter name : The name for the run to be scheduled.

Implementation

Future<ScheduleRunResult> scheduleRun({
  required String projectArn,
  required ScheduleRunTest test,
  String? appArn,
  ScheduleRunConfiguration? configuration,
  String? devicePoolArn,
  DeviceSelectionConfiguration? deviceSelectionConfiguration,
  ExecutionConfiguration? executionConfiguration,
  String? name,
}) async {
  ArgumentError.checkNotNull(projectArn, 'projectArn');
  _s.validateStringLength(
    'projectArn',
    projectArn,
    32,
    1011,
    isRequired: true,
  );
  ArgumentError.checkNotNull(test, 'test');
  _s.validateStringLength(
    'appArn',
    appArn,
    32,
    1011,
  );
  _s.validateStringLength(
    'devicePoolArn',
    devicePoolArn,
    32,
    1011,
  );
  _s.validateStringLength(
    'name',
    name,
    0,
    256,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DeviceFarm_20150623.ScheduleRun'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'projectArn': projectArn,
      'test': test,
      if (appArn != null) 'appArn': appArn,
      if (configuration != null) 'configuration': configuration,
      if (devicePoolArn != null) 'devicePoolArn': devicePoolArn,
      if (deviceSelectionConfiguration != null)
        'deviceSelectionConfiguration': deviceSelectionConfiguration,
      if (executionConfiguration != null)
        'executionConfiguration': executionConfiguration,
      if (name != null) 'name': name,
    },
  );

  return ScheduleRunResult.fromJson(jsonResponse.body);
}