createReport method

Future<Map> createReport({
  1. DateTime? startDate,
  2. DateTime? endDate,
  3. required ReportTypeEnum type,
  4. DateTime? year,
  5. ReportFormatEnum? format,
  6. String? productId,
  7. String? accountId,
  8. String? email,
  9. String? profileId,
})

Create a report

Generates a report. Reports are either for past account history or past fills on either all accounts or one product's account.

https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postreports

Implementation

Future<Map> createReport({
  DateTime? startDate,
  DateTime? endDate,
  required ReportTypeEnum type,
  DateTime? year,
  ReportFormatEnum? format,
  String? productId,
  String? accountId,
  String? email,
  String? profileId,
}) async {
  var response = await _reportsRestClient.createReport(
    startDate: startDate,
    endDate: endDate,
    type: type,
    year: year,
    format: format,
    productId: productId,
    accountId: accountId,
    email: email,
    profileId: profileId,
  );

  if (response.statusCode != 200) throw response;

  return json.decode(response.body);
}