copyWith method

ProxyConfig copyWith({
  1. String? targetUrl,
  2. String? proxyUrl,
  3. Map<String, String>? headers,
  4. Duration? timeout,
  5. int? retries,
  6. bool? cacheEnabled,
  7. String? cacheDir,
  8. Duration? cacheTtl,
})

Returns a copy with selected fields replaced.

Implementation

ProxyConfig copyWith({
  String? targetUrl,
  String? proxyUrl,
  Map<String, String>? headers,
  Duration? timeout,
  int? retries,
  bool? cacheEnabled,
  String? cacheDir,
  Duration? cacheTtl,
}) {
  return ProxyConfig(
    targetUrl: targetUrl ?? this.targetUrl,
    proxyUrl: proxyUrl ?? this.proxyUrl,
    headers: headers ?? this.headers,
    timeout: timeout ?? this.timeout,
    retries: retries ?? this.retries,
    cacheEnabled: cacheEnabled ?? this.cacheEnabled,
    cacheDir: cacheDir ?? this.cacheDir,
    cacheTtl: cacheTtl ?? this.cacheTtl,
  );
}