taskStep.dhall 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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 TextJSONPair = { mapKey : Text, mapValue : JSON.Type }
  6. let render
  7. : Types.TaskStep → Types.JSONObject
  8. = λ(t : Types.TaskStep) →
  9. Prelude.List.concat
  10. TextJSONPair
  11. [ toMap
  12. { task = JSON.string t.task
  13. , privileged = RenderOptional.bool t.privileged
  14. , vars = RenderOptional.jsonObject t.vars
  15. , params = RenderOptional.textTextMap t.params
  16. , image = RenderOptional.text t.image
  17. , input_mapping = RenderOptional.textTextMap t.input_mapping
  18. , output_mapping = RenderOptional.textTextMap t.output_mapping
  19. , tags = RenderOptional.lists.text t.tags
  20. , timeout = RenderOptional.text t.timeout
  21. , attempts = RenderOptional.natural t.attempts
  22. }
  23. , ./taskSpec.dhall t.config
  24. ]
  25. in render