copy method
APIResponse<T>
copy({
- APIResponseStatus? status,
- T? payload,
- Object? payloadDynamic,
- bool nullPayload = false,
- Etag? payloadETag,
- String? payloadFileExtension,
- CacheControl? cacheControl,
- Map<
String, dynamic> ? headers, - Object? mimeType,
- Duration? keepAliveTimeout,
- int? keepAliveMaxRequests,
- Object? error,
- StackTrace? stackTrace,
- Map<
String, APIMetric> ? metrics,
Copy this response.
Implementation
APIResponse<T> copy(
{APIResponseStatus? status,
T? payload,
Object? payloadDynamic,
bool nullPayload = false,
Etag? payloadETag,
String? payloadFileExtension,
CacheControl? cacheControl,
Map<String, dynamic>? headers,
Object? mimeType,
Duration? keepAliveTimeout,
int? keepAliveMaxRequests,
Object? error,
StackTrace? stackTrace,
Map<String, APIMetric>? metrics}) {
return APIResponse(status ?? this.status,
payload: nullPayload
? null
: (payload ?? (payloadDynamic == null ? this.payload : null)),
payloadDynamic: nullPayload ? null : payloadDynamic,
payloadMimeType: mimeType ?? payloadMimeType,
payloadFileExtension: payloadFileExtension,
payloadETag: payloadETag ?? this.payloadETag,
cacheControl: cacheControl ?? this.cacheControl,
headers: headers ?? this.headers,
keepAliveTimeout: keepAliveTimeout ?? this.keepAliveTimeout,
keepAliveMaxRequests: keepAliveMaxRequests ?? this.keepAliveMaxRequests,
error: error,
stackTrace: stackTrace,
metrics: metrics ?? _metrics)
.._copyStartedMetrics(this);
}