copyWith method

ClientConfig copyWith({
  1. ClientType? clientType,
  2. String? baseUrl,
  3. Duration? connectTimeout,
  4. Duration? receiveTimeout,
  5. Duration? sendTimeout,
  6. Map<String, String>? defaultHeaders,
  7. List<ClientInterceptor>? interceptors,
  8. bool? followRedirects,
  9. int? maxRedirects,
  10. bool? validateCertificates,
  11. bool? enableLogging,
  12. int? maxRetries,
  13. Duration? retryDelay,
  14. bool? exponentialBackoff,
  15. Set<int>? retryStatusCodes,
  16. Set<int>? successCodes,
  17. Set<int>? errorCodes,
})

Creates a copy of this config with the specified changes.

Implementation

ClientConfig copyWith({
  ClientType? clientType,
  String? baseUrl,
  Duration? connectTimeout,
  Duration? receiveTimeout,
  Duration? sendTimeout,
  Map<String, String>? defaultHeaders,
  List<ClientInterceptor>? interceptors,
  bool? followRedirects,
  int? maxRedirects,
  bool? validateCertificates,
  bool? enableLogging,
  int? maxRetries,
  Duration? retryDelay,
  bool? exponentialBackoff,
  Set<int>? retryStatusCodes,
  Set<int>? successCodes,
  Set<int>? errorCodes,
}) {
  return ClientConfig(
    clientType: clientType ?? this.clientType,
    baseUrl: baseUrl ?? this.baseUrl,
    connectTimeout: connectTimeout ?? this.connectTimeout,
    receiveTimeout: receiveTimeout ?? this.receiveTimeout,
    sendTimeout: sendTimeout ?? this.sendTimeout,
    defaultHeaders: defaultHeaders ?? this.defaultHeaders,
    interceptors: interceptors ?? this.interceptors,
    followRedirects: followRedirects ?? this.followRedirects,
    maxRedirects: maxRedirects ?? this.maxRedirects,
    validateCertificates: validateCertificates ?? this.validateCertificates,
    enableLogging: enableLogging ?? this.enableLogging,
    maxRetries: maxRetries ?? this.maxRetries,
    retryDelay: retryDelay ?? this.retryDelay,
    exponentialBackoff: exponentialBackoff ?? this.exponentialBackoff,
    retryStatusCodes: retryStatusCodes ?? this.retryStatusCodes,
    successCodes: successCodes ?? this.successCodes,
    errorCodes: errorCodes ?? this.errorCodes,
  );
}