reportsOrgsNewCreate method

Future<ReportCreate?> reportsOrgsNewCreate(
  1. String org,
  2. ReportRequest reportRequest
)

Triggers a new report generation. If the report has been previously requested, it returns the status of the report The current duration for generated report {settings.REPORT_EXPIRY_SECONDS/3600} hours. Given a sample result of the api call json [ { \"data\": [ { \"display_name\": \"User Report 1\", \"description\": \"A short Description of Report 1\", \"report_name\": \"report-1\", \"icon\": \"http://some-icon.png\", \"extra_query_params\": [ \"course_id\", \"learner_id\" ], \"status\": {} } ] } ] The body of the request would be json { \"report_name\": \"report-1\", \"owner\": \"owner-name\" \"learner_id\": \"learner-id\", \"course_id\": \"course-id\", }

Parameters:

Implementation

Future<ReportCreate?> reportsOrgsNewCreate(String org, ReportRequest reportRequest,) async {
  final response = await reportsOrgsNewCreateWithHttpInfo(org, reportRequest,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ReportCreate',) as ReportCreate;

  }
  return null;
}