copyWith method

ApiRequestOptions copyWith({
  1. Map<String, String>? headers,
  2. Map<String, String>? cookies,
  3. bool? noAuth,
  4. bool? retry,
  5. bool clearRetry = false,
  6. bool? retryUnsafeRequest,
  7. String? idempotencyKey,
  8. CancelToken? cancelToken,
  9. String? operationId,
  10. ApiCallLogOptions? log,
  11. bool clearLog = false,
  12. List<String>? invalidateCacheTags,
  13. List<String>? invalidateCachePaths,
  14. bool? clearActiveSessionCache,
})

Implementation

ApiRequestOptions copyWith({
  Map<String, String>? headers,
  Map<String, String>? cookies,
  bool? noAuth,
  bool? retry,
  bool clearRetry = false,
  bool? retryUnsafeRequest,
  String? idempotencyKey,
  CancelToken? cancelToken,
  String? operationId,
  ApiCallLogOptions? log,
  bool clearLog = false,
  List<String>? invalidateCacheTags,
  List<String>? invalidateCachePaths,
  bool? clearActiveSessionCache,
}) =>
    ApiRequestOptions(
      headers: headers ?? this.headers,
      cookies: cookies ?? this.cookies,
      noAuth: noAuth ?? this.noAuth,
      retry: clearRetry ? null : retry ?? this.retry,
      retryUnsafeRequest: retryUnsafeRequest ?? this.retryUnsafeRequest,
      idempotencyKey: idempotencyKey ?? this.idempotencyKey,
      cancelToken: cancelToken ?? this.cancelToken,
      operationId: operationId ?? this.operationId,
      log: clearLog ? null : log ?? this.log,
      invalidateCacheTags: invalidateCacheTags ?? this.invalidateCacheTags,
      invalidateCachePaths: invalidateCachePaths ?? this.invalidateCachePaths,
      clearActiveSessionCache:
          clearActiveSessionCache ?? this.clearActiveSessionCache,
    );