describeJobExecution method

Future<DescribeJobExecutionResponse> describeJobExecution({
  1. required String jobId,
  2. required String thingName,
  3. int? executionNumber,
  4. bool? includeJobDocument,
})

Gets details of a job execution.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ServiceUnavailableException. May throw CertificateValidationException. May throw TerminalStateException.

Parameter jobId : The unique identifier assigned to this job when it was created.

Parameter thingName : The thing name associated with the device the job execution is running on.

Parameter executionNumber : Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned.

Parameter includeJobDocument : Optional. When set to true, the response contains the job document. The default is false.

Implementation

Future<DescribeJobExecutionResponse> describeJobExecution({
  required String jobId,
  required String thingName,
  int? executionNumber,
  bool? includeJobDocument,
}) async {
  ArgumentError.checkNotNull(jobId, 'jobId');
  ArgumentError.checkNotNull(thingName, 'thingName');
  _s.validateStringLength(
    'thingName',
    thingName,
    1,
    128,
    isRequired: true,
  );
  final $query = <String, List<String>>{
    if (executionNumber != null)
      'executionNumber': [executionNumber.toString()],
    if (includeJobDocument != null)
      'includeJobDocument': [includeJobDocument.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/things/${Uri.encodeComponent(thingName)}/jobs/${Uri.encodeComponent(jobId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeJobExecutionResponse.fromJson(response);
}