copyWith method
DiscoverResult
copyWith({
- ResultMetaObject? meta,
- DiscoverResultCacheScope? cacheScope,
- ServerCapabilities? capabilities,
- String? instructions,
- String? resultType,
- List<
String> ? supportedVersions, - int? ttlMs,
A copy with the given properties replaced; everything else, unknown keys included, is kept.
Implementation
DiscoverResult copyWith({
ResultMetaObject? meta,
DiscoverResultCacheScope? cacheScope,
ServerCapabilities? capabilities,
String? instructions,
String? resultType,
List<String>? supportedVersions,
int? ttlMs,
}) =>
DiscoverResult.fromJson({
...toJson(),
if (meta != null) '_meta': $encode(meta),
if (cacheScope != null) 'cacheScope': $encode(cacheScope),
if (capabilities != null) 'capabilities': $encode(capabilities),
if (instructions != null) 'instructions': $encode(instructions),
if (resultType != null) 'resultType': $encode(resultType),
if (supportedVersions != null) 'supportedVersions': $encode(supportedVersions),
if (ttlMs != null) 'ttlMs': $encode(ttlMs),
});