cgetFeedback method

Future<Response<FeedbackPagination>> cgetFeedback({
  1. required String xKeyclicApp,
  2. String? acceptLanguage,
  3. DateTime? xDateTime,
  4. String? xKeyclicAppPlatform,
  5. String? xKeyclicAppVersion,
  6. String? batch,
  7. List<String>? batchesLeftSquareBracketRightSquareBracket,
  8. DateTime? after,
  9. DateTime? before,
  10. List<String>? geoHashLeftSquareBracketRightSquareBracket,
  11. List<String>? orderLeftSquareBracketRightSquareBracket,
  12. String? organization,
  13. List<String>? organizationsLeftSquareBracketRightSquareBracket,
  14. int? page,
  15. int? limit,
  16. CancelToken? cancelToken,
  17. Map<String, dynamic>? headers,
  18. Map<String, dynamic>? extra,
  19. ValidateStatus? validateStatus,
  20. ProgressCallback? onSendProgress,
  21. ProgressCallback? onReceiveProgress,
})

Retrieve all Feedback resources.

Parameters:

  • xKeyclicApp
  • acceptLanguage
  • xDateTime
  • xKeyclicAppPlatform
  • xKeyclicAppVersion
  • batch
  • batchesLeftSquareBracketRightSquareBracket
  • after
  • before
  • geoHashLeftSquareBracketRightSquareBracket
  • orderLeftSquareBracketRightSquareBracket
  • organization
  • organizationsLeftSquareBracketRightSquareBracket
  • page - Page of the overview.
  • limit - Page of the overview.
  • cancelToken - A CancelToken that can be used to cancel the operation
  • headers - Can be used to add additional headers to the request
  • extras - Can be used to add flags to the request
  • validateStatus - A ValidateStatus callback that can be used to determine request success based on the HTTP status of the response
  • onSendProgress - A ProgressCallback that can be used to get the send progress
  • onReceiveProgress - A ProgressCallback that can be used to get the receive progress

Returns a Future containing a Response with a FeedbackPagination as data Throws DioError if API call or serialization fails Keyclic API documentation. Also see Retrieve all Feedback resources. Documentation

Implementation

Future<Response<FeedbackPagination>> cgetFeedback({
  required String xKeyclicApp,
  String? acceptLanguage,
  DateTime? xDateTime,
  String? xKeyclicAppPlatform,
  String? xKeyclicAppVersion,
  String? batch,
  List<String>? batchesLeftSquareBracketRightSquareBracket,
  DateTime? after,
  DateTime? before,
  List<String>? geoHashLeftSquareBracketRightSquareBracket,
  List<String>? orderLeftSquareBracketRightSquareBracket,
  String? organization,
  List<String>? organizationsLeftSquareBracketRightSquareBracket,
  int? page,
  int? limit,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final String path = r'/feedbacks';
  final options = Options(
    method: r'GET',
    headers: <String, dynamic>{
      // to string ??
      if (acceptLanguage != null) r'accept-language': acceptLanguage,
      if (xDateTime != null) r'x-date-time': xDateTime,
      r'x-keyclic-app': xKeyclicApp,
      if (xKeyclicAppPlatform != null)
        r'x-keyclic-app-platform': xKeyclicAppPlatform,
      if (xKeyclicAppVersion != null)
        r'x-keyclic-app-version': xKeyclicAppVersion,
      ...?headers,
    },
    extra: <String, dynamic>{
      'secure': <Map<String, String>>[
        {
          'type': 'apiKey',
          'name': 'bearer',
          'keyName': 'Authorization',
          'where': 'header',
        },
      ],
      ...?extra,
    },
    validateStatus: validateStatus,
  );

  final queryParameters = <String, dynamic>{
    if (batch != null) r'batch': encodeQueryParameter(batch),
    if (batchesLeftSquareBracketRightSquareBracket != null)
      r'batches[]': encodeCollectionQueryParameter(
          batchesLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (after != null) r'after': encodeQueryParameter(after),
    if (before != null) r'before': encodeQueryParameter(before),
    if (geoHashLeftSquareBracketRightSquareBracket != null)
      r'geo_hash[]': encodeCollectionQueryParameter(
          geoHashLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (orderLeftSquareBracketRightSquareBracket != null)
      r'order[]': encodeCollectionQueryParameter(
          orderLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (organization != null)
      r'organization': encodeQueryParameter(organization),
    if (organizationsLeftSquareBracketRightSquareBracket != null)
      r'organizations[]': encodeCollectionQueryParameter(
          organizationsLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (page != null) r'page': encodeQueryParameter(page),
    if (limit != null) r'limit': encodeQueryParameter(limit),
  };

  final response = await _apiClient.dio.request<Object>(
    path,
    options: options,
    queryParameters: queryParameters,
    cancelToken: cancelToken,
    onSendProgress: onSendProgress,
    onReceiveProgress: onReceiveProgress,
  );

  FeedbackPagination responseData;

  try {
    responseData = await _apiClient.deserializeAsync<FeedbackPagination>(
        response.data!, 'FeedbackPagination');
  } catch (error, stackTrace) {
    throw DioError(
      requestOptions: response.requestOptions,
      response: response,
      type: DioErrorType.other,
      error: error,
    )..stackTrace = stackTrace;
  }

  return Response<FeedbackPagination>(
    data: responseData,
    headers: response.headers,
    isRedirect: response.isRedirect,
    requestOptions: response.requestOptions,
    redirects: response.redirects,
    statusCode: response.statusCode,
    statusMessage: response.statusMessage,
    extra: response.extra,
  );
}