copyWith method

ListPromptsResult copyWith({
  1. ResultMetaObject? meta,
  2. String? nextCursor,
  3. List<Prompt>? prompts,
  4. ListPromptsResultCacheScope? cacheScope,
  5. String? resultType,
  6. int? ttlMs,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

ListPromptsResult copyWith({
  ResultMetaObject? meta,
  String? nextCursor,
  List<Prompt>? prompts,
  ListPromptsResultCacheScope? cacheScope,
  String? resultType,
  int? ttlMs,
}) =>
    ListPromptsResult.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (nextCursor != null) 'nextCursor': $encode(nextCursor),
      if (prompts != null) 'prompts': $encode(prompts),
      if (cacheScope != null) 'cacheScope': $encode(cacheScope),
      if (resultType != null) 'resultType': $encode(resultType),
      if (ttlMs != null) 'ttlMs': $encode(ttlMs),
    });