deleteExternalService method

Future<Response<void>> deleteExternalService({
  1. required String xKeyclicApp,
  2. required String externalService,
  3. String? acceptLanguage,
  4. DateTime? xDateTime,
  5. String? xKeyclicAppPlatform,
  6. String? xKeyclicAppVersion,
  7. CancelToken? cancelToken,
  8. Map<String, dynamic>? headers,
  9. Map<String, dynamic>? extra,
  10. ValidateStatus? validateStatus,
  11. ProgressCallback? onSendProgress,
  12. ProgressCallback? onReceiveProgress,
})

Remove one ExternalService resource.

Parameters:

  • xKeyclicApp
  • externalService - The identifier of the resource.
  • acceptLanguage
  • xDateTime
  • xKeyclicAppPlatform
  • xKeyclicAppVersion
  • 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 Throws DioError if API call or serialization fails Keyclic API documentation. Also see Remove one ExternalService resource. Documentation

Implementation

Future<Response<void>> deleteExternalService({
  required String xKeyclicApp,
  required String externalService,
  String? acceptLanguage,
  DateTime? xDateTime,
  String? xKeyclicAppPlatform,
  String? xKeyclicAppVersion,
  CancelToken? cancelToken,
  Map<String, dynamic>? headers,
  Map<String, dynamic>? extra,
  ValidateStatus? validateStatus,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) async {
  final String path = r'/external-services/{externalService}'
      .replaceAll('{' r'externalService' '}', externalService.toString());
  final options = Options(
    method: r'DELETE',
    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,
  );

  return _apiClient.dio.request<Object>(
    path,
    options: options,
    cancelToken: cancelToken,
    onSendProgress: onSendProgress,
    onReceiveProgress: onReceiveProgress,
  );
}