postIncoming method

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

Create one Incoming resource.

Parameters:

  • xKeyclicApp
  • 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 Create one Incoming resource. Documentation

Implementation

Future<Response<void>> postIncoming({
  required String xKeyclicApp,
  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'/webhooks/incoming';
  final options = Options(
    method: r'POST',
    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>>[],
      ...?extra,
    },
    validateStatus: validateStatus,
  );

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