copyWith method
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,
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,
);
}