asNotModified method
Transform this response to a NOT_MODIFIED
response.
Implementation
APIResponse<T> asNotModified(
{T? payload,
Object? payloadDynamic,
Map<String, dynamic>? headers,
Object? mimeType,
Etag? eTag,
CacheControl? cacheControl,
Duration? keepAliveTimeout,
int? keepAliveMaxRequests,
Map<String, APIMetric>? metrics}) {
return APIResponse.notModified(
payload: payload ?? (payloadDynamic == null ? this.payload : null),
payloadDynamic: payloadDynamic,
headers: headers ?? this.headers,
mimeType: mimeType ?? payloadMimeType,
eTag: eTag ?? payloadETag,
cacheControl: cacheControl ?? this.cacheControl,
keepAliveTimeout: keepAliveTimeout ?? this.keepAliveTimeout,
keepAliveMaxRequests: keepAliveMaxRequests ?? this.keepAliveMaxRequests,
metrics: metrics ?? _metrics)
.._copyStartedMetrics(this);
}