This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ResourceType.dhall
50 lines (43 loc) · 1.63 KB
/
ResourceType.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
let ResourceType
: ∀(_params : { Source : Type, SourceGetParams : Type }) →
{ Type : Type
, default :
{ privileged : Optional Bool
, params : Optional _params.SourceGetParams
, check_every : Optional Text
, tags : Optional (List Text)
, unique_version_history : Optional Bool
}
}
= λ(_params : { Source : Type, SourceGetParams : Type }) →
{ Type =
{ name : Text
, type : Text
, source : _params.Source
, privileged : Optional Bool
, params : Optional _params.SourceGetParams
, check_every : Optional Text
, tags : Optional (List Text)
, unique_version_history : Optional Bool
}
, default =
{ privileged = None Bool
, params = None _params.SourceGetParams
, check_every = None Text
, tags = None (List Text)
, unique_version_history = None Bool
}
}
let example =
let RegistryImage = ./resource-types/RegistryImage.dhall
let GithubListRepos = ./resource-types/GithubListRepos.dhall
let Source = RegistryImage.Source.Type
let SourceGetParams = RegistryImage.Params.Get.Type
let ResourceType = ResourceType { Source, SourceGetParams }
in ResourceType::{
, name = GithubListRepos.meta.name
, type = RegistryImage.meta.name
, source = RegistryImage.Source::GithubListRepos.meta.{ repository }
, params = Some RegistryImage.Params.Get::{ format = Some "rootfs" }
}
in ResourceType