invoke method

FutureOr<Map> invoke({
  1. required String uriPath,
  2. Map<String, dynamic>? uriQueryParameters,
  3. Map? parameters,
  4. Map? headersParameters,
  5. String? apiKey,
  6. List<int>? statusCodes,
  7. String? keyResultList,
  8. String method_request = "get",
  9. String specialTypeName = "ok",
})

call api with latest features DOCS: https://doodstream.com/api-docs#

Implementation

FutureOr<Map> invoke({
  required String uriPath,
  Map<String, dynamic>? uriQueryParameters,
  Map? parameters,
  Map? headersParameters,
  String? apiKey,
  List<int>? statusCodes,
  String? keyResultList,
  String method_request = "get",
  String specialTypeName = "ok",
}) async {
  int try_count = 0;
  while (true) {
    await Future.delayed(Duration(microseconds: 1));

    try {
      return await _invokeRaw(
        uriPath: uriPath,
        uriQueryParameters: uriQueryParameters,
        parameters: parameters,
        headersParameters: headersParameters,
        apiKey: apiKey,
        statusCodes: statusCodes,
        method_request: method_request,
        specialTypeName: specialTypeName,
        keyResultList: keyResultList,
      );
    } catch (e) {
      if (try_count >= 3) {
        rethrow;
      }
      try_count++;
      if (e is ClientException) {
        continue;
      } else {
        rethrow;
      }
    }
  }
}