cgetReviewsByOrganization method

Future<Response<ReviewPagination>> cgetReviewsByOrganization({
  1. required String xKeyclicApp,
  2. required String organization,
  3. String? acceptLanguage,
  4. DateTime? xDateTime,
  5. String? xKeyclicAppPlatform,
  6. String? xKeyclicAppVersion,
  7. List<String>? orderLeftSquareBracketRightSquareBracket,
  8. String? category,
  9. List<String>? categoriesLeftSquareBracketRightSquareBracket,
  10. DateTime? after,
  11. DateTime? before,
  12. String? delegatedTo,
  13. List<String>? delegatedTosLeftSquareBracketRightSquareBracket,
  14. List<String>? ratingLeftSquareBracketRightSquareBracket,
  15. String? task,
  16. List<String>? tasksLeftSquareBracketRightSquareBracket,
  17. int? page,
  18. int? limit,
  19. CancelToken? cancelToken,
  20. Map<String, dynamic>? headers,
  21. Map<String, dynamic>? extra,
  22. ValidateStatus? validateStatus,
  23. ProgressCallback? onSendProgress,
  24. ProgressCallback? onReceiveProgress,
})

Retrieve all Review resources.

Parameters:

  • xKeyclicApp
  • organization - The identifier of the resource.
  • acceptLanguage
  • xDateTime
  • xKeyclicAppPlatform
  • xKeyclicAppVersion
  • orderLeftSquareBracketRightSquareBracket
  • category
  • categoriesLeftSquareBracketRightSquareBracket
  • after
  • before
  • delegatedTo
  • delegatedTosLeftSquareBracketRightSquareBracket
  • ratingLeftSquareBracketRightSquareBracket
  • task
  • tasksLeftSquareBracketRightSquareBracket
  • 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 ReviewPagination as data Throws DioError if API call or serialization fails Keyclic API documentation. Also see Retrieve all Review resources. Documentation

Implementation

Future<Response<ReviewPagination>> cgetReviewsByOrganization({
  required String xKeyclicApp,
  required String organization,
  String? acceptLanguage,
  DateTime? xDateTime,
  String? xKeyclicAppPlatform,
  String? xKeyclicAppVersion,
  List<String>? orderLeftSquareBracketRightSquareBracket,
  String? category,
  List<String>? categoriesLeftSquareBracketRightSquareBracket,
  DateTime? after,
  DateTime? before,
  String? delegatedTo,
  List<String>? delegatedTosLeftSquareBracketRightSquareBracket,
  List<String>? ratingLeftSquareBracketRightSquareBracket,
  String? task,
  List<String>? tasksLeftSquareBracketRightSquareBracket,
  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'/organizations/{organization}/reviews'
      .replaceAll('{' r'organization' '}', organization.toString());
  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 (orderLeftSquareBracketRightSquareBracket != null)
      r'order[]': encodeCollectionQueryParameter(
          orderLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (category != null) r'category': encodeQueryParameter(category),
    if (categoriesLeftSquareBracketRightSquareBracket != null)
      r'categories[]': encodeCollectionQueryParameter(
          categoriesLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (after != null) r'after': encodeQueryParameter(after),
    if (before != null) r'before': encodeQueryParameter(before),
    if (delegatedTo != null)
      r'delegated_to': encodeQueryParameter(delegatedTo),
    if (delegatedTosLeftSquareBracketRightSquareBracket != null)
      r'delegated_tos[]': encodeCollectionQueryParameter(
          delegatedTosLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (ratingLeftSquareBracketRightSquareBracket != null)
      r'rating[]': encodeCollectionQueryParameter(
          ratingLeftSquareBracketRightSquareBracket,
          format: ListFormat.multi),
    if (task != null) r'task': encodeQueryParameter(task),
    if (tasksLeftSquareBracketRightSquareBracket != null)
      r'tasks[]': encodeCollectionQueryParameter(
          tasksLeftSquareBracketRightSquareBracket,
          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,
  );

  ReviewPagination responseData;

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

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