taskConfig.dhall 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. let Types = ../types/package.dhall
  2. let Prelude = ../lib/prelude.dhall
  3. let JSON = Prelude.JSON
  4. let RenderOptional = ./optionals/package.dhall
  5. let TextOptionalTextPair = { mapKey : Text, mapValue : Optional Text }
  6. let render
  7. : Types.TaskConfig → JSON.Type
  8. = λ(c : Types.TaskConfig)
  9. → JSON.object
  10. ( toMap
  11. { platform = JSON.string c.platform
  12. , run = ./taskRunConfig.dhall c.run
  13. , image_resource = ./imageResource.dhall c.image_resource
  14. , rootfs_uri = RenderOptional.text c.rootfs_uri
  15. , container_limits =
  16. ./taskContainerLimits.dhall c.container_limits
  17. , inputs =
  18. RenderOptional.lists.generic
  19. Types.TaskInput
  20. ./taskInput.dhall
  21. c.inputs
  22. , outputs =
  23. RenderOptional.lists.generic
  24. Types.TaskOutput
  25. ./taskOutput.dhall
  26. c.outputs
  27. , caches =
  28. RenderOptional.lists.generic
  29. Types.TaskCache
  30. ./taskCache.dhall
  31. c.caches
  32. , params =
  33. RenderOptional.jsonObject
  34. ( Prelude.Optional.map
  35. (List TextOptionalTextPair)
  36. Types.JSONObject
  37. ./textOptionalTextMap.dhall
  38. c.params
  39. )
  40. }
  41. )
  42. in render