resourceType.dhall 994 B

12345678910111213141516171819202122232425262728293031
  1. let Prelude = ../lib/prelude.dhall
  2. let Types = ../types/package.dhall
  3. let JSON = Prelude.JSON
  4. let RenderOptional = ./optionals/package.dhall
  5. let renderInBuilt = λ(ignored : Text) → None JSON.Type
  6. let renderCustom =
  7. λ(c : Types.CustomResourceType)
  8. → Some
  9. ( JSON.object
  10. ( toMap
  11. { name = JSON.string c.name
  12. , type = JSON.string c.type
  13. , source = RenderOptional.jsonObject c.source
  14. , privileged = RenderOptional.bool c.privileged
  15. , params = RenderOptional.jsonObject c.params
  16. , check_every = RenderOptional.text c.check_every
  17. , tags = RenderOptional.text c.tags
  18. , unique_version_history =
  19. RenderOptional.bool c.unique_version_history
  20. }
  21. )
  22. )
  23. in λ(r : Types.ResourceType)
  24. → merge { InBuilt = renderInBuilt, Custom = renderCustom } r