ToolWithApiKeyDto.fromModel constructor

ToolWithApiKeyDto.fromModel(
  1. ToolModel tool, {
  2. ServerModel? server,
})

Implementation

factory ToolWithApiKeyDto.fromModel(ToolModel tool, {ServerModel? server}) =>
    ToolWithApiKeyDto(
      id: tool.id,
      alias: tool.alias,
      host: tool.host,
      port: tool.port,
      apiKey: tool.apiKey,
      status: tool.status,
      serverId: tool.serverId,
      materializedArtifactDigest: tool.materializedArtifactDigest,
      contentState: tool.contentState,
      server: server != null
          ? ToolServerDto.fromModel(server)
          : tool.serverIdentity == null
          ? null
          : ToolServerDto.fromIdentity(tool.serverIdentity!),
    );